How can I screen input in a textbox?

Yes, For this, it’s usually best to start by subclassing the TextBox control so that your solution is reusable within your project (or outside your project). Override OnTextChanged, or for more control, OnKeyPress and OnKeyDown. OnKeyPress fires for printable characters; OnKeyDown fires for all key combinations. Both of these offer a Handled property in the event arguments parameter, which you can set to True to cancel the event.

How To Validate If TextBox Contains A Valid Date?

Explain : use contaxt.handler

there is Context.Handler object for state management…which is used to transferring data from one page to second page i have problem i just take three form one first page(_default) there is one textbox and one button i has done data transferring from _default to default2 page and i just want to move from default2 to default3 without using context.handler that can be possible but problem is here when ever in returning from default3 to default2 that show exception in context.handler object so how i can handle this

What are Cached events?

They are placed in the ViewState of the page and executed on the server side.

example: TextChanged event of the TextBox.
SelectedIndexChanged event of the DropDownList.

To execute them, some postback must occur.

What is the use of AutoPostBack ?

AutoPostBack is a feature available that is available on few controls.
The main purpose of this feature is that, if there is any change done on the client side, then it should be handled on the server side.


<asp:TextBox AutoPostBack="TRUE|FALSE" runat="server"/>

<form runat="server">
<asp:TextBox id="txtBox1" runat="server" AutoPostBack="TRUE" />

What is viewstate and use of view state?

Viewstate is a client side state management technique or method. View state is a temporary storage media to store any value in page level only.

Viewstate is also used to maintain state of server controls like textbox during postbacks of a page.

In view state, you can also store structured data like arraylist, dataset etc.


Lets say there is data table filled with data.

DataTable dt=new Datatable();

//fill dt with data and store it in viewstate to persist its value in page during postbacks.

//store value in view state


//get value from view state

DataTable dt=(DataTable)ViewState["MyTable"];

string strUser=string)

How will you access a TextBox contains in a Master Pages from Content Page?

We can access master page controls from the content pages.

For examples :-

TextBox txtbx = (TextBox)Master.FindControl("txtMaster");

txtbx .Text = "DotnetFunda";
In the above code, FindControl is a method which is taking name of the control which is in the master page. Then it is casting in the textbox. Now, with the help of the text property we can assign any property.