Posts

Showing posts with the label Client Side

How to set max limt of File Upload in Asp.net

Many times I faced the same problem with all my applications, that is Max size of file to be uploaded to server. By default, the maximum size limit of a file to be uploaded to a server using the ASP.NET FileUpload control is 4MB. You cannot upload anything that is larger than this limit. If you wants to upload a file more the size of 4 MB which is by default, you have to make some changes in the application's web.config: <configuration> <system.web> <httpRuntime maxRequestLength="xxx" /> </system.web> </configuration> Below is the small description of the parameters attributes. maxRequestLength - Attribute limits the file upload size for ASP.NET application. This limit can be used to prevent denial of service attacks (DOS) caused by users posting large files to the server. The size specified is in kilobytes. As mentioned earlier, the default is "4096" (4 MB). Max value is "1048576" (1 GB) for .NET Framework ...

How to pass server values to Javascript using Eval()

In my application I have a target to show message if user does not have permission to navigate to another page. I can do this by using server code but it will make a round trip to server and make a bad user experience so, I decided to use java script. Following is the function of Java Script <script language="javascript" type="text/javascript"> function func_Message(obj) { if (parseFloat(obj)>0) { return true; } else { alert("Please assign a value before viewing the details"); return false; } } </script> And following is the code of Link Button from where I am passing value to Java Script Function <asp:LinkButton ID="lnk_Details" runat="server" Text="Details" CommandArgument='<%# Eval("festi_id") +"~" + Eval("user_id") %>' CommandName="ViewDet...

Auto Complete Example in Asp.net C# Using JQuery

Image
Download Running Code Supporting JQuery Before writing this post I had written one another post which is using a pure JavaScript to show Auto complete or Auto delete example. My previous example is not using Jquery which is a famous and reliable way to present your data. One of the drawback of my previous example is it will become slow as I have to load a bulk data for auto complete box. I had received many comments on this post, some of them had appreciated and some of them had suggested using Jquery. One of my great readers had given an example of Jquey which I am posting to help you all. So, before posting this example I would like to say thanks to my reader Eng. Mohammed Ibrahim who had suggested and helped me to help others.

Auto Complete Example in Asp.net C#

There are too many methods to make an auto complete text box in asp.net You can use JQuery ( Use jquery for Auto Complete ), Ajax Auto complete extender and so on. If you will search on internet you will find so many examples which are using JQuery or Ajax Extender to show auto complete on websites. I had searched on many sites I had tried so many examples to populate auto complete list but, unfortunately, I am not able to find an efficient auto complete example. Finally after searching for many hours I had decided to write my own code. My example is using an asp.net C# to show auto complete. Here, code goes Download Code Run and try typing some numbers or text. You will find an auto complete list on page

How to Debug JavaScript Using C#

Image
Client Java Script is one of the most important things in web development but not the best and easiest to develop. Building of bigger and more complicated scripts, especially using DOM model or form field values can cause a lot of frustration and head pain. Moreover, JavaScript debugging is not easy and obvious as should be. But there is a hope. Before start, we should ensure that client script debugging is not disabled in IE as it is by default. Suitable options are located on advanced tab of Internet Options where both script debugging checkboxes should be unchecked. Go to Tools>>Options >> and refer image below. You can also download code from http://www.4shared.com/file/106977680/64e2c2b2/DebugJavascript.html Now open your code and put Debugger; key word in your code. Refer image below Now run your code, on IE. You will find and window. Refer image below. Click yes to start debugging. It will take some time to open debu...

Client side validations in C# using javascript

Client-side validation uses the same error display mechanism as server-side checking. Validating input data on web pages is usually a function performed by the server. The web page allows the user to enter data, and when the Submit button is pressed, the browser wraps up the data into an HTTP request and sends it to the server. The server checks each data field to make sure it is valid, and if any problems are found, a new form along with error messages is sent back to the browser. Wouldn't it be much more useful if problems could be detected in the browser before a server request is made? This approach would provide two primary advantages. It would lighten the load on the server, and, more importantly, it would notify the user of a problem with a data field almost immediately after he or she entered the bad data. This supports the truism that errors are cheapest to fix the closer the detection is to the original creation of the error. For example, if there is a problem with a zip ...