|
You can also true viewstate on as well. Or use viewstate
Before Post
<br />
ViewState["UserName"] = UserName<br />
After Post
<br />
UserName = ViewState["UserName"]<br />
Remember this will not persit between pages.
Look where you want to go not where you don't want to crash.
Bikers Bible
|
|
|
|
|
I prefer to use viewstate in these type of cases where we need to store data in encrypted format, so that no one can recognize the real data. If that is not needed hidden fields are a better choice, since viewstate can end up to be very large.
Pradipta Basu
|
|
|
|
|
Pradipta Basu wrote: Hi,
I don't know how it happened. I posted the answer but it was posted by someone else name. The data is also not proper. So I'm posting it again.
You should use session only when you have to persit data between more than one page.
Otherwise if it is related to only one page, you can fetch data from database and store it into a html hidden control, ie, .
Data stored in server side html hidden cotrols are persisted during a postback.
Thanks,
Pradipta Basu
-Prakash
|
|
|
|
|
I'm having problems finding the best way to set the mouse over attribute for several buttons.
right now I do something like :
btnClear.Attributes.Add('onMouseOut', 'setStyleOff(this.id));
and I do this in the page load for each button, a mouse over and a mouse out event
However this can get quite tedious when you want all your buttons to have the same effect and some of them are embedded in datalists or grids.
Is it possible to set the mouse over/out event in a skin file or a CSS style sheet so that it will run the same java function for EVERY button on a page?
If so, could someone give an example of how to do this?
Kris
|
|
|
|
|
IMO, you'll have at least two options here:
+ Use the skin file to define the client side mouse events for the server button control.
+ It's a good candidate to develop a custom button control which by defalt has the mouse event handlers defined.
|
|
|
|
|
Could you give me an example on the syntax to add a mouse over event to a button in a skin file?
The only way I know how to do this is code file for a given page.
|
|
|
|
|
In a skin file, you simply declare the button:
<asp:button on_mouseover="yourclientsidefunction();" ..../> then in the Page directive, you can simply set the theme for the web page. The settings of the button in the skin file of the specified theme will be applied to all the buttons on the web page.
|
|
|
|
|
Hi Guys,
We have been having a discussion around our shop about how we are going to persist data from one page to the next. As usuall we have different opinions. Ok first things first. We are using 2.0 framework and VS 2005. We have a header for each page that is 98% static, won't change unless someone enters a new order #. We are going to use MS Ent Lib 2.0 with a wrapper around it just so we can remain consistant with its usage. So now getting to the meat of the question. Some of us thought we would persist the data in a base page using session, using Enterprise "cache" or httpContext. What do u guys think of using these different options and how would you persist the data between pages?
Thanks,
Jamming J
|
|
|
|
|
i want to show the data from my database which is set by sql 2000 on the drop down list. However, i dont know how to start though the connection is fine. thanks for concerning my question
|
|
|
|
|
hi,
Inside If Not IsPostBack() Then.... End If you have to create the dataset and bind it to that drop down list. Consider the following code:
Dim dsTest As New DataSet<br />
Dim daTest As New SqlDataAdapter("select tid from test", con)<br />
daTest.Fill(dsTest)<br />
<br />
ddl.DataSource = dsTest<br />
ddl.DataTextField = "test"<br />
ddl.DataBind()
|
|
|
|
|
|
Hello.
Does anyone tried to use cross domain cookies?
I have two asp.net applications running on diferent servers on the Internet. When my users visit the first application I create a cookie with some values.
When the user visits (or gets redirected) to the second application I need to retrive the values to be used on the second application.
Does anyone tried to use this or know if this is possible?
Thanks in advance
|
|
|
|
|
How to Import the contacts from Outlook.
I found solution on it, but it has some problems.
I've done following steps
- I've imported the ACTIVEX component which access Outlook contacts and delivers it in text file.
-Access that file and put contacts in database
PROBLEM - When the text file is delivered then Clent accesses SERVER's fiel instead of it's own file.
|
|
|
|
|
How to access C:\ or D:\ with Java script.
|
|
|
|
|
The short answer: under normal circumstances, you can't.
The browser runs as a sandbox with no rights to the user's local machine. The basic idea is to ensure that no web code can perform actions that could damage the user's machine. Allowing access directly to the client's drives would be a major security exploit. Unless you are developing for a controlled environment, such as your corporate intranet, you really don't want to go down this road.
That being said, there are two ways that come to mind to accomplish it. If you are concerned with IE only, you could write an ActiveX control that has functions to interact with the drives, and manipulate it using javascript. As a cross-browser alternative, you could also create a signed javascript file, and assert that you need local file system permissions.
Hope that helps a bit.
--Jesse
|
|
|
|
|
How can I run the routine in ActiveX control through Javascript.
|
|
|
|
|
You will link the ActiveX control into the page using the HTML object[^] tag. At that point, it becomes just another object on the page. You can retrive it using normal javascript DOM techniques, such as getElementById()[^]. Once you have a reference to the ActiveX control, you can access any public members of it.
Hope that helps.
--Jesse
|
|
|
|
|
How to navigate through dropdownlist with arrow keys .
Whenever we change the index of dropdown then the SelectedIndexChanged Event Occurs, but we dont want to fire this event on Up and Down arrow keys then what to do?
Also I have another question that - when the focus is on the dropdown and we press CTRL+F4 then dropdown of AddressBar opens Instead of that dropdown.
|
|
|
|
|
To navigate the dropdownlist, you'll need to write some javascript to handle the onkeypress event. In that code, you'll want to test for the arrrow keys, and adjust the dropdown list's selectedIndex property. Google has plenty of examples. To get you started, check out:- An example[^] of handling key presses
- An example[^] of working with the dropdown list's options and selected index
As far as the behavior of CTRL+F4, opening the IE address bar is an operating system level decision. I believe that you can capture the keypress, perform your desired action, and not bubble the event using the same technique as above. I haven't tested it, so you may want to give it a try.
Hope that helps.
--Jesse
|
|
|
|
|
How to navigate through dropdownlist with arrow keys .
Whenever we change the index of dropdown then the SelectedIndexChanged Event Occurs, but we dont want to fire this event on Up and Down arrow keys then what to do?
Also I have another question that - when the focus is on the dropdown and we press CTRL+F4 then dropdown of AddressBar opens Instead of that dropdown.
|
|
|
|
|
Set the auto postback property to false. This will stop the post back event from getting fired.
|
|
|
|
|
Hi guys,
i am transforming an file called XMLFile.xml along with the appropriate xslt file
like this:
XPathDocument surveyDoc = new XPathDocument(Server.MapPath("XMLFile.xml"));
// Load the xslt to do the transformations
XslTransform transform = new XslTransform();
transform.Load(Server.MapPath("dynamicControls.xslt"));
// Get the transformed result
StringWriter sw = new StringWriter();
transform.Transform(surveyDoc, null, sw);
But the xmlfile.xml contents are like:
<formname name="BusinessUnit">
<contol type="text" name="BuisnessUnit" value="FirstName" required="yes">
<contol type="text" name="Code" validation="true" value="LastName" valtype="numbers">
<contol type="text" name="LegalEntity" value="EmailId">
<contol type="text" name="Place" value="DOB">
<contol type="text" name="DateOfBirth" value="BusinessUnit">
followed by another form details.
<formname name="foreign unit">
details
so i want to specify the required formname in new XPathDocument=(Server.MapPath("XMLFile.xml")); //i.e BusinessUnit for ex: not the entire
xml file how can i pass only the required xml content(i.e only a part of the xml file containing required form details) want for transformation.I.e i dont want to transform foreign unit part also within the xml file.Please throw some light on this.
Thks in advance,
-- modified at 6:56 Sunday 16th July, 2006
|
|
|
|
|
Hi all
I am new in ASP.NET and i neet to find and record visitors IP address. i tried some ways but sorrily the IP of visitors are not real and i recieve just one IP for all visitors.i think that is a virtual IP of my HOST(10.0.0.3). i use this codees:
1) System.Net.Dns.GetHostByAddress(System.Net.IPAddress.Parse(System.Web.HttpContext.Current.Request.UserHostName)).HostName
2)System.Net.Dns.GetHostByAddress(Request.ServerVariables.Item("REMOTE_HOST")).HostName()
3)Request.ServerVariables("REMOTE_ADDR")
4)HttpContext.Current.Request.UserHostAddress.ToString
5)HttpContext.Current.Request.UserHostName.ToString
but i get Te IP:10.0.0.3 for all visitors.
Can anyone help me please and what is the problem??
thank all
|
|
|
|
|
Rather then trying to invoke a DNS lookup, have you tried using the UserHostAddress property of the Request object?
For example:
string clientIP = Request.UserHostAddress;
--Jesse
|
|
|
|
|
Hi
yes sir i used Request.UserHostAddress but the result was that and that was like other codes. and sorilly i can't find real IP Address. where is the problem???
|
|
|
|