Many times we want same model popup is open on the different buttons(links) without postback.i.e. by using client side script. Consider we have a page default.aspx on this page we have two button or link for same work like in your project there is two links (button) for login. If we want open same model popup on the different buttons then we add a dummy button and set their visibility fa...
Most of time we need to call page method(server side code) by client side script(JavaScript) without post back. I will accomplish this using the Page Methods feature. To do this we are using ASP.Net Ajax. Using page method a JavaScript knowledge will help. Create a script manager control on your form, to use PageMethods,we will need to set the EnablePageMethods property to true of Script...
Bind() : Bind method used when user can modify the value i.e for edit/update. Bind is a 2 way of databinding i.e. bi-directional databinding. Eval() : Eval is one way Binding i.e. it is like read only. Suppose we have a gridview control and want to only display the data, not perform any other action then we can use Eval() to bind the data. If we want to edit the information in the gridvi...
Here we discuss login in ASP.NET,this is specially help to that user’s which is new in ASP.NET.Login is the basic thing for any application. In login we use the ADO.NET Object such as SqlConnection,SqlCommend and SqlParameter. Suppose we have a table User and user table contains the column UserId, UserName, Password. We create a page with name Login.aspx and we design your login page in ...
One famous problem is to call selected button on the enter key.Suppose we have registration page and want when I fill all information and press enter key the submit button call.Another situation is on the login page when we press enter key login button call.In these cases we need to trap the enter key.this can we do in two ways one for javascript and another from the C#.In C# code we als...
Here we discuss how to generate the random password. Random password increase the security of website it simply provide the non easily guessable password.Here we generate a set of random digits by combining a set of alphabets and numbers and special characters. After generating the random passsword it is the combination of string,number and special characters. One of the simplest way to ...
Many times , we face a situation where we want to place checkboxes inside repeater, datalist, gridview, etc. and we want all checkboxes are check, uncheck on the client side. Here we discuss the solution using JavaScript.To implement this we take a data control Repeater . Below is the javaScript code use that: <script type="text/javascript" language="javascript"> function CheckAll(...
Many times users are facing the problem to validate the date from Javascript.Here we discuss to validate date.I have Two text box for start date and end date now we validate end date always greater than start date. Following is the Javascript code to validate the date. Html code of the textboxex are: <table> <tr> <td> Start date:</td> <td> <input name="st...
Date and Time is almost used in all application.Here we discuss about the date time format in asp.net. we can set datetime format following are some formats. d - day of the month, like 2 dd - day of month ,like 02 it leads 0 ddd - first 3 character of the name of the week day, like Mon ddd - Full name of the week day, like Monday M - Month without leading 0, like 2 MM - Month with lading...
In ASP.NET's Ajax Rating control there is a bug. When user click on the rating control it Jumps on the top of the page because it add # with url. If you put your rating control on the bottom of the page and you click on the rating control it jumps on the top of the page.This happens because your all image tag are in HTML's Anchor <a> tag and its href attribute set to # (view page s...
When we upload a file then there is validation for the extension of the upload file because if we want to uplaod a image then there is only image related extension is allowed not any other type as .doc,.txt,.rar ...... so to avoid this we apply there extension validation on the file. when user upload the file then we first check the extension of the file if extension of the file is corre...
When you set the mode of the TextBox is Password and retrive the password from the DB then the TextBox will be blank for security purpose If you want to display the password in the textbox in * format then we use following way to retrive the password in Textbox and the mode of the Textbox is Password. txtPassword.Attributes.Add("value","vijendra"); where txtPassword is the name of the Te...
File upload control is not working when this control is inside the update panel.When we place the file upload control control inside the updatepanel and upload the file then FileUpload1.Hasfile is always false because file upload control is inside updatepanel then your file upload control does not post back. Because the file upload control works only when the full page postback. If you w...
Here we discuss to generate the textox at runtime. To create the textbox at run time for that first we take a server control Panel where we place the runtime generated textbox.Here we use a textbox and button,textbox to define the number of textbox generated at runtime ant generate the textbox on the button click. following is the code for .aspx side: <div> <asp:TextBox runat="s...
Many developers save the password in normal form in Database which is not secure for the user because every one who have the access of the database view your password it is very harmful for the user. To encode the password use the using System.Security.Cryptography namespace; Following is the method to encode the pwd in MD5 format. using System; using System.Collections; using System.Con...
We can insert the ListItem in Dropdownlist at any postion there is two ways to insert the listItem in the Dropdownlist. Always remember Add and Insert is different Insert takes 2 parameter and Add takes only one Parameter. syntax: drpUserName.Items.Insert(0, new ListItem("Please Select User Name", "0")); drpUserName.Items.Add(new ListItem("Please Select User Name", "0")); This will inser...
Change the color of the userinput fileld if it is blank(empty). Example: first we apply RequiredField Validation and CustomValidator to validate the user input of check the empty control if any user input control is empty then we use javascript to change the color ogf the user input control. following is the javascript code to change the color of the input control. <script language="j...
QueryString: In ASP.NET QueryString plays very imporatnt role by which we get value(s) from one page to another page(which we send in QueryString). we send the value in QueryString something like: Response.Redirect("default.aspx?userId=12"); we also send the value in QueryString like: Response.Redirect("default.aspx?userId=" +txtName.Text .Trim()); and that QueryString value retrive in f...
Delete the multiple recored from repeter or datalist . plz go through this example: <asp:Button ID="bntDelete" runat="server" Text="Delete " CommandName="Delete" oncommand="bntDelete_Command" /> <br /> <asp:Repeater ID="repeater1" runat="server" DataMember="EmailID"> <HeaderTemplate> <tr> <th> <input type="checkbox" id="checkAll" onclick="CheckAll(t...
In ASP.NET there is a server side validation which is very powerful and easy to use for developers and automatically validates the user input. Beginner developer facing problem when they validate a particular section of the page and page has more than one button in this case they are facing problem. suppose we have a registration page there is two button one for Save and another for Canc...
I have faced a problem when i m doing url rewriting in my project.I am using a repeater in which I show the Forum name and a topic post name when I click on the Forum name it redirect on the test.aspx page and when i click on the topic Postname it redirect on the test1.aspx. In url rewriting my url rewriting format for Forum name is www.test.com/gorupname/forumid/forumName.aspx and for t...
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address:
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18