Loading ...

Who is online?  0 guests and 0 members
home  »  blogs  »  Vijendra Shakya

Communifire Blogs

Vijendra Shakya : Most Recent postings

Vijendra Shakya

Open Ajax ModelpopupExtender from Javascript

4/16/2009 by Vijendra Shakya · 1 · 4826

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...

Vijendra Shakya

Call PageMethod From JavaScript in ASP.NET Ajax

4/14/2009 by Vijendra Shakya · 4 · 20462

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...

Vijendra Shakya

Difference Between Eval() and Bind() methods in ASP.NET.

3/10/2009 by Vijendra Shakya · 1 · 8166

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...

Vijendra Shakya

Create Login Page in ASP.NET

3/10/2009 by Vijendra Shakya · 6 · 26894

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 ...

Vijendra Shakya

Traps the enter key

3/5/2009 by Vijendra Shakya · 1 · 5172

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...

Vijendra Shakya

Generate Random Password

2/24/2009 by Vijendra Shakya · 5 · 2916

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 ...

Vijendra Shakya

Check/Uncheck checkboxes in Repeater using JavaScript

2/18/2009 by Vijendra Shakya · 1 · 14809

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(...

Vijendra Shakya

Validate Dates from Javascript or Serversidevalidation

2/13/2009 by Vijendra Shakya · 2 · 6278

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...

Vijendra Shakya

DateTime Format in ASP.NET

2/3/2009 by Vijendra Shakya · 3 · 26472

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...

Vijendra Shakya

Maintain Scroll Position of ASP.NET Ajax Rating Control

1/22/2009 by Vijendra Shakya · 1 · 4921

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...

Vijendra Shakya

Validate Extension of FileUpload Control

1/14/2009 by Vijendra Shakya · 1 · 5020

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...

Vijendra Shakya

Retrive Password in TextBox which is in Password mode

1/12/2009 by Vijendra Shakya · 0 · 3755

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...

Vijendra Shakya

FileUpload inside the Ajax UpdatePanel

1/12/2009 by Vijendra Shakya · 2 · 9910

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...

Vijendra Shakya

Dynamically Genearte TextBox at runtime in ASP.Net

1/9/2009 by Vijendra Shakya · 1 · 8735

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...

Vijendra Shakya

How to Encode a password using MD5 in C#

1/9/2009 by Vijendra Shakya · 1 · 5961

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...

Vijendra Shakya

Insert/Add a ListItem to a DropDownList

1/5/2009 by Vijendra Shakya · 0 · 5001

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...

Vijendra Shakya

Change the color of the Textbox

1/5/2009 by Vijendra Shakya · 0 · 11861

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...

Vijendra Shakya

Pass Query String and retrieve it for one or more than one values in ASP.Net

1/4/2009 by Vijendra Shakya · 0 · 7943

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...

Vijendra Shakya

Delete multiple records from repeater or Datalist

1/2/2009 by Vijendra Shakya · 0 · 4413

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...

Vijendra Shakya

Server Side Validation on a particular Button Click

12/31/2008 by Vijendra Shakya · 0 · 5631

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...

Vijendra Shakya

Problem with URL Rewriting in ASP.Net

12/30/2008 by Vijendra Shakya · 1 · 15891

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...

Product Spotlight

ASP.NET Hosting Spotlight

Join CodeAsp.Net for FREE Today!

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:

 

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?