|
What is scope of Viewstate Variable?
|
|
|
|
|
prasadnjoshi wrote: What is scope of Viewstate Variable?
Please read this article,
Beginner's Guide To View State [^]
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Before flooding this forum with inane questions ( that all have the same title ), why not read a book or two ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
What is difference between Viewstate and Querystring?
|
|
|
|
|
Querystring is derved from the URL
Example: http://test.com/User.aspx?useid=123
And you need to retreive it on User.aspx as,
string UserID=Request.QueryString["userid"].ToString();
View State is one of the most important and useful client side state management mechanism. It can store the page value at the time of post back (Sending and Receiving information from Server) of your page. ASP.NET pages provide the ViewState property as a built-in structure for automatically storing values between multiple requests for the same page.
Example:
If you want to add one variable in View State,
ViewState["Var"]=Count;
For Retrieving information from View State
string Test=ViewState["TestVal"];
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
how can find out the last value of table
|
|
|
|
|
People are not Going to be patient as am to you. When you post a Qustion you need to be specific
if its an Identity Field you can do it like this
SELECT MAX(ID) AS LastID FROM mytable
or read this
http://blog.sqlauthority.com/2007/03/25/sql-server-identity-vs-scope_identity-vs-ident_current-retrieve-last-inserted-identity-of-record/[^]
Dont Forget to Google Next Time
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
select Top 1 * from table order by id Desc
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
This has nothing to do with ASP.NET, and it shows you have no idea at all what you're doing. You should start with a basic book.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi All,
I would like to perform some validation on an entry into a text box in the TextChanged event without causing the entire page to refresh.
In a Email-ID TextBox m checking whether that mailid is duplicate or not.
I want to prevent user by entering duplicate mail-id.
I used Update Panel, still it get refresh.
any solution ??
|
|
|
|
|
why text change event ? Its means you are doing post back on every changed of textbox char. Do it on Submit button click. And Place the control inside upodate panel.
Priyagdpl wrote: I used Update Panel, still it get refresh.
Do you have multiple update panel in the page ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You can use the Generic Handler for this purpose. Just put ur whole logic to identify the duplicate email then call this handler via xmlhttprequest.
var xmlhttp;
function InitXmlHttpRequest() {
xmlhttp = null;
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
function CheckDuplicateEmail(url) {
InitXmlHttpRequest();
var handleStateChanged = function() {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
try {
alert("message from server : " + xmlhttp.responseText);
}
catch (e) {
}
}
else {
}
}
};
if (xmlhttp != null) {
xmlhttp.onreadystatechange = handleStateChanged;
xmlhttp.open("GET", url, true);
xmlhttp.send(null);
}
else {
}
}
now you can call this js method (CheckDuplicateEmail) on any event like textchangesd, lostfocus or keyup. Here the url is the Url of the Generic Handler u have created in previous step. The ResponseText will give you the data that u have returned from Generic Handler.
I hope it gonna help u.
|
|
|
|
|
I am adding a handler to dragdropcontrol(ajax control) on mouseup so that i can get new position of control when mouse is up and fire button click event from javascript function. even handler is added on pageLoad (javascript function). event gets fired with IE but not with firefox and google chrome. please help. code is given below:
C# code:
//***dpe is dragdropextender control
string strScript = @"<script type='text/javascript' language='javascript'> function pageLoad(){Sys.UI.DomEvent.addHandler($find('" + dpe.BehaviorID + "').get_element(), 'dragend', onMouseUp);} </script>";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "", strScript);
Javascript function is:
function onMouseUp()
{
document.getElementById('<% =btnResetPosition.ClientID %>').click();
}
|
|
|
|
|
Hi All,
Custom conetext menu(Custom controls) of extended gridview is working only in IE, and not working in firefox. Kindly please suggest me the ways to fix it.
modified on Thursday, September 24, 2009 2:29 AM
|
|
|
|
|
saritha_codeproject wrote: Custom conetext menu(Custom controls) of extended gridview
What Do U Mean By Tht Can You please Explain..! May Be I am New
Is It MenuCountrol?
If No Plz Ignore..
If It Helps Click It as Answer
|
|
|
|
|
r u using any third party control ? if yes then specify which control u r using at what place and how?
|
|
|
|
|
Hi Nisha
Actually I have added dll of custom controls from here . so I am making use of extended gridview control form those and now attaching context menu to a rowbased event of a context menu. Its working fine in IE and Firefox is not showing context menu on right click.
Kindly let me know how can I display Context Menu in both IE and Firefox.
|
|
|
|
|
I m sorry but i have not used this control. but why don't u post ur problem threre and specify there exactly what problem u r facing. they would be able to solve ur problem.
|
|
|
|
|
Hi all,
What type of data i can keep in global.ajax file.After login,can i store userid and username (login specific details).Please guide me.
Thanks in advance,
Srinivas Mateti
|
|
|
|
|
|
It is global.asax not global.ajax.
sris 426 wrote: After login,can i store userid and username (login specific details)
No. Are you referring to the session_start event handler? If yes, it fires when the ASP.NET session starts not when your user logs in.
|
|
|
|
|
When user logs in which event will be fired?
|
|
|
|
|
No ! Global.asax done his opertaion before that. What do you want ? Do you want to store the session informatio or what ? Please tell your business requirments.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I have a web application which is similar to group management.So every user will belong to one group.When user logs in I need to refer his group related details like group and and also his user related details such as userid,user name and assigned roles for him.Instead of getting these global details in every form,cant I store them in one place (global.asax) and refer where ever i required.If yes please provide the information and problems with it.
Thanks in advance,
Srinivas Mateti
|
|
|
|
|
if you want to store the information related to the user then you can do at the same place where User gets login. Just fetch the information from the DB for that user and then store it in a Session.
To store it in a single variable, you can create a simple class. just place the variables that would hold the info required by you. now it's very easy. just create the object of this class, assign values to the variables and then place this object in the session. Now access the session variable at any page .
modified on Thursday, September 24, 2009 9:28 AM
|
|
|
|