client-side

How to set html input type text value using ASP.NET C#?

十年热恋 提交于 2019-12-06 02:47:58
问题 I have an html control which I want to set its value .... here's the control: <input runat="server" id="first_name_txt" type="text" placeholder="First Name" /> in code behind, I use: first_name_txt.Value = String.empty; but the value of my input control still has the old value like "blah-blah" and not set to "". 回答1: Its old question , but may help someone. You have to use Request.Form to get and call .Value to set the value. HTML <input runat="server" id="first_name_txt" type="text"

Does react-dom/server work on the client-side?

佐手、 提交于 2019-12-05 22:25:55
I need to render top-level html tags on the client-side (for example, <html><head>...</head><body></body></html> ). The result will be injected into an iframe. On the server, I would use the renderToStaticMarkup function from react-dom/server , but the client-only react-dom doesn't have this function. Will react-dom/server work on the client in the latest version of react (currently 15.3.0)? If so, is there any indication from the react dev team that it will continue to be supported on the client in future versions? tl;dr: yes. I verified that it works in react@15.3.0 . The facebook/react team

Pure HTML + JavaScript client side templating

醉酒当歌 提交于 2019-12-05 20:33:16
问题 I want to have achieve something similar to Java Tiles framework using only client side technologies (no server side includes). I would like to have one page, eg layout.html which will contain layout definition. Content placeholder in that page would be empty #content div tag. I would like to have different content injected on that page based on url. Something like layout.html?content=main or layout.html?content=edit will display page with content replaced with main.html or edit.html. The

Can the server use a file from a client without uploading it to the server? ASP.NET

柔情痞子 提交于 2019-12-05 18:24:22
I was wondering, at the moment, the client uploads a file to a directory on the server where the server can then use the file (csv file) to update a SQL database. Is that the only way the server can use that file? For it to first be uploaded to the server? Or can you use that file without uploading it to a directory of the server? (using visual studio 2012, C# and asp.net) Code update--- asp Uploading the file. (I know the code can be cleaner an written better, but my testing code is never clean) //Uplod file to the server FileUpload1.SaveAs(serverUploadDir + FileUpload1.FileName); //Use the

Business logic in JavaScript. Fat client vs thin client

泪湿孤枕 提交于 2019-12-05 17:19:39
问题 Is it a good idea to implement business logic on the client side with JavaScript? What kind of logic should be there? Validation Logic? Related to GUI? What would you do if the same logic want to be used in another application (exposed) implementing it in JavaScript would mean you can't reuse that logic. On the other hand having all logic on the server side would mean more requests to the server. What do you think? 回答1: You can create reusable Javascript modules so there's no intrinsic

Page_ClientValidate is not defined

不羁岁月 提交于 2019-12-05 16:24:26
I am using ASP.NET 2.0 and I'm using IE8 as my default browser but no matter how many times I try, Page_ClientValidate keeps giving me this error that it is not defined. How can I solve this problem? Please help. ..so.. i think may be there is not any RequiredValidator Control in your page~~ 来源: https://stackoverflow.com/questions/3227830/page-clientvalidate-is-not-defined

Check if user is blocking 3rd party domain

匆匆过客 提交于 2019-12-05 13:15:45
I have run into an issue where a lot of our support calls are about our images not loading because the user is blocking amazon s3 or a similar 3rd party service. I use 3rd party services for hosting images, video, and some javascript. Is there a way to detect through javascript if a client is blocking a domain so that we display a message instead of having the user contact support? $.ajax 'http://aws.amazon.com/s3/', type: 'GET', dataType: 'html' complete: (e, xhr, settings) -> if e.status == 200 console.log "Not Blocking S3" else console.log "Blocking S3" Based on the comments I made an

Why use Url.Content for referencing resources?

隐身守侯 提交于 2019-12-05 11:44:44
In almost every ASP.NET MVC example I've come across, I always see Url.Content being used to reference CSS, JavaScript, and Images. Not once has anyone explained WHY to use it. Anyone care to explain? What's so bad about doing: <img src="/Content/Img/MyImage.png" alt="My Image" /> <script src="/Scripts/jquery.js" type="text/javascript"></script> <link href="/Content/Css/Default.css" rel="stylesheet" type="text/css" media="all" /> What you have works the same as Url.Content(). Url.Content() is just like adding a ~ to be beginning of your paths: <script src="~/Scripts/jquery.js" type="text

Client side Callback in GWT

人走茶凉 提交于 2019-12-05 11:06:04
I'm trying to create a logger for a GWT application as an exercise to evaluate GWT. What I specifically want to do is have it so that I can post messages to a client side label at any point from the server side. So, if some interesting stuff has happened on the server the client can be updated. My First question is, is this possible, I can understand it not being. Second, if it is possible, where should I look for information, I've tried google and their documentation and all the showcases have nothing on this. Thanks Well, there are a couple of Options. You need to get the data from the

less.js - get variable values inside parsers' callback

冷暖自知 提交于 2019-12-05 10:36:55
I am using less.js (1.3.0) to parse less to css on the client side. Inside the parsers' callback I want to get the value for each variable. i tried the following without success. var data = "@colour: red; #example { background-color: @colour; }", parser = new less.Parser({}); parser.parse(data, function (error, root) { console.log( root.toCSS() ); var varsDef = root.variables(); for (k in varsDef) { console.log(varsDef[k]); // how to get the value for the var? //not working console.log(varsDef[k].eval()); //not working console.log(varsDef[k].toCSS()); //is an object but looking for a string