Postbacks Lose The Hash In The URL?
Oct 7, 2010
On an ASP.NET page with a tabstrip, I'm using the hash code in the URL to keep track of what tab I'm on (using the BBQ jQuery plugin). For example:
http://mysite.com/foo/home#tab=budget
Unfortunately, I've just realized that there are a couple of places on the page where I'm using an old-fashioned ASP.NET postback to do stuff, and when the postback is complete, the hash is gone:
http://mysite.com/foo/home
... so I'm whisked away to a different tab. No good.
This is a webforms site (not MVC) using .NET 4.0. As you can see, though, I am using URL routing.
Is there a way to tell ASP.NET to keep the hash in the URL following a postback?
View 1 Replies
Similar Messages:
May 19, 2010
Hopefully someone knows a way to fix this issue, but here is my problem. I need to be able to recreate a md5 hash that will be the equivalent of the hash that php would generate.
The encoding I have tried is listed below. None of these will produce the same values.
UnicodeEncoding
UTF7Encoding
UTF8Encoding
UTF32Encoding
View 6 Replies
Feb 15, 2011
why when I create a checkbox using HTML.CheckboxFor the values remain after postback where as if I just create a simple HTML checkbox in HTML after postback the value is no longer there?
What is the difference between HTML.Checkbox vs. an HTML checkbox? Why does one retain the values after postback and one does not?
View 1 Replies
Sep 7, 2010
Just to be forward, my .net and c# expierence is very limited, that one could say I'm a complete noob :) However I do have some grasp on OOP as I usually work in PHP (FWIW). My problem seems to be with this line:
Session["total"] = dt.Compute("SUM(price)", "").ToString();
which will output a total of say "9.2" where as the price is "9.20" from a few record lines as such:
dt.Rows.Add(strRecord, 9.20, dropDownListDistrict_stepTitle.Text);
thus 9.20 + 9.20 = "18.40", but the page displays "18.4".
The label that displays the total sum is:
<asp:Label ID="labelTotal3" runat="server" Text="0" />
From what I've gathered, I'm suffering from some kind of type casting problem? Hopefully I haven't missed anything, its a bit difficult to show all the code but hopefully someone can point me in the right direction? Question is; how can I get an extra decimal place to show up on my sum (or why is it dropping the last decimal place?).
View 6 Replies
Oct 11, 2010
I've declared some properties in MasterPage
[Code]....
and I'm gonna set their value through other web forms
[Code]....
but the problem is when I navigate to another page, the content of MasterPage is lost
View 2 Replies
May 21, 2010
I am validating my text box with regular expression validator(Email). What i need is if i enter a wrong format and if i click on tab t should not move to next text box.
View 14 Replies
Dec 12, 2010
I have a Wizard server control to collect data and send it as an Email in the last step the problem i think that the page post back and clear the fields:
[Code]....
View 6 Replies
Aug 20, 2010
[ThreadStatic]
private static BackgroundProcessManager2 _Instance;
public static BackgroundProcessManager2 Instance
{
get
{
if (_Instance == null) // **
{
_Instance = new BackgroundProcessManager2();
}
return _Instance;
}
}
And ussually everything is fine, but this time on every page load _Instance is null.
Additionally, i have very strange error when trying to watch _Instance in line marked **:
Cannot fetch the value of field '_Instance' because information about the containing class is unavailable.
What can couse this class to upload?
View 1 Replies
Apr 23, 2010
Ok I have this object.ascx. Everythings works fine in an Add scenario (model is null). However when the model isn't null I have metadata for the property in object.ascx then when I call Html.Editor(prop.PropertyName) I have a default instance of modelmetadata within that template. About the only value that is preserved is propertyname. My AdditionalValues are gone, IsRequired, Watermark etc all have default values. I'm seeing bizarro state driven behaviour like this all over the place when it comes to templates. It is peeving me.
[Code]....
So my question is: Why does having a non-null model cause a completely unexpected (and stupid) behaviour? I find it hard to believe this is intended.
View 1 Replies
Mar 8, 2011
We have a problem on a new server where disabling a themed button loses its theme. This happens consistently on all buttons now.
We just switched to a new iis server 7.5 using asp.net framework 4.0
Before, the buttons through out the website have a nice style/theme. These are not set inside each button and there are no classes set specifically for buttons I dont think but I believe inherit the theme from I believe the web.config in either:
All the buttons did display a nice light blue gradient, and when disabled they go a few shades lighter blue
For some reason now in .net framework 4.0 all disabled buttons seem to lose their theme and become the default grey color. Enabling them again brings its theme back
why the disabled button would look different now?
View 1 Replies
Aug 25, 2010
I dynamically create gridview, and in this grid I have template field also
field.HeaderTemplate = New GridViewTemplate(ListItemType.Header, col.ColumnName)
field.ItemTemplate = New GridViewTemplate(ListItemType.Item, col.ColumnName)
grdEmpty.Columns.Add(bfield)
but when enter some value in text box in this template field i lose value on postback. And also on postback I lose all template field and i must re-create this grid.
My goal is: I have button and i want to add new row in this grid, but i want to have old value also.
View 1 Replies
Oct 23, 2010
When we disabled the viewstate in gridview its lose value but this case not true with Textbox control why?
View 1 Replies
Sep 28, 2010
I have an issue of keeping the authentication and session state on a downloaded page, on the same website.
I have 2 pages, page 1 will download page 2, using the following code:
Page 1 code:
System.Net.WebClient webClient = new System.Net.WebClient();
byte[] buffer = webClient.DownloadData("http://www.mywebsite.co.uk/page2.aspx");
return Encoding.UTF8.GetString(buffer);
but the authentication is lost, so i needed to re-login in page 2 by writing auto login code myself.
But then the session is lost, so the session variables set in page 1 cannot be share to page 2, and vice versa.
View 3 Replies
Jan 6, 2010
I'm using a GridView to display some columns and rows that reside in a database. This works excellent. Because i wanted to add columns dynamically out of a List of names. Let's say we have a list with 5 names in it, then it dynamically creates a column for every name in the GridView.
Here's some code to display what i do:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
//Create columns for each student
List<Student> allStudents = new Eetlijst.Business.Students().GetAll();
allStudents.Reverse();.......
How do i create the dynamic columns for each row? I create them with a DataBound event. So when the GridView databinds, the columns get filled with data. There is also a check inside to see if the row is in edit mode or not. So when i click on the edit button next to the row, the row goes perfectly in edit mode. The code i made adds a TextBox control to the cell.
When i fill in a value and press the Update button, it can't find any controls anymore and therefore i can't get the value i entered. The control is still there in the DataBound when i put a break point after it. But as soon as i click the Update button, all the controls of the cells are gone.
I searched on the internet and all i found is that it has something to do with the application firing a postback before it reaches the RowUpdating method.
So, how can i let the controls exist that i added to the cell when it is in edit mode?
View 2 Replies
Nov 30, 2010
I'm using a Ajax SliderExtender in a UpdatePanel. I set a BehaviorID and call $find('behavorID').add_valueChanged function in the $document.Ready. Everything is fine but when I press F5 and refresh the page, I lose the slider in a 1/3 (wtf) chance. If I set var slider = $find('behavorID'), it recognises slider is null.
View 1 Replies
May 4, 2010
I have a web page with several databound (via their property's) user controls in a multiview in a formview.
I decided to try Ajax (Adding ScriptManager, updatepanel etc).
All works fine except for the user controls.
The controls I use to contain the usercontrol property values ((invisible) Textboxes or Hidden fields) lose their value when i change from ond multiview panel to another. (In other words: usercontrols on invisible multiview panels lose their property value's). (When I change a multiviewpanel all the property fields turn emty, when i hit the update button of the formview afterwards the emty values are propagated to the database. (resulting in loss of data)) Textbox seems to hold its value, hiddenfield loses its value (when changing from one multiview panel to another).
This seems to be a coplication of the multiview in combination with ajax.
View 1 Replies
Mar 31, 2010
have a checkbox (AllofNevada) that should enable/disable a checkboxlist (of counties in Nevada). The javascript code I have works. I placed the code:
[code]....
This is fine in the beginning but once the user selects 'save' and the code:
[code]....
View 2 Replies
Apr 22, 2010
I have an external javascript file which I include to my page on the code behind (as seen below).
My problem is, when I my page makes a postback (not partial one), I check the loaded scripts by using FireBug, and I cannot see the javascript file in the list after the post back. I asusmed once it is included to page on the first load, browser will be caching it so that I do not need to re-include it.
What am I doing wrong?
[code]...
View 1 Replies
Aug 29, 2010
I can't figure out why these collapsible panels are losing their white space inbetween each header after the panel is collapsed.
[Code]....
View 4 Replies
Jun 8, 2010
My web application was in .NET framework 1.1 initially. It has a few ASP server grids and some third party controls (Infragistics). I had it migrated to .NET framework 3.0.
Now I've added a few ASP server grids('GridView'). The thing is when the session('InProc') ends after 20 mins, the rows of the newly added grids disappear. However, this is not happening with the grids that were present already pre-migration. I am not using any session variables to initialise or bind the new grids.
This is happening only if the controls are added in the web forms that were involved in the framework migration process. If the control is added in the new web form, then this issue's not occuring.
Also I am not allowed to change the session state to any other. It has to remain 'InProc'. Continuing the session indefinitely is also not an option.
View 1 Replies
May 12, 2010
I set a session at login and I lose it after about 3 button clicks. I don't know why. The following is what I have in my webconfig:
<sessionState
timeout="52000"></sessionState>.
View 2 Replies
Feb 11, 2010
I have a variable such as this string URL="http//:localhost, myhomepage";
how do I easily add the above into a hash table? With the url part being the key and the description being the value.
View 2 Replies
Mar 10, 2011
Is there a build in library in .NET that can compute secure one-way hash ? I mean a library that implements SHA-2 cryptographic hash function or something similar.
If is there is no SHA-2 implementation some weaker hash funcion would be sufficient. If there are more options I prefer the most secure one.
provide a use example e.g. provide the code that returns one-way hash for string mySampleString.
View 3 Replies
Apr 4, 2011
I have such URL
localhost/Login/LogOn?ReturnUrl=/#&q=my%20search%20word&f=1//447044365|2//4
I need to get hash parameters to navigate in the application after authentication.
I try to catch it like this
<input name="returnUrl" value="<%= ViewContext.HttpContext.Request.Url.PathAndQuery %>" type="hidden" />
But result is
/Login/LogOn?ReturnUrl=/
I tried to take away "/#" in the URL, then I get whole URL. But I need to use this URL as it is.
View 1 Replies
Apr 23, 2010
I need to pass some info to a 3rd party (for tracking) and they require I provide a checksum value which is an md5 hashed amalgamation of some of the other values. This is my code :
[Code]....
They keep rejecting my checksum. When I have tested for the following value passed in preConvert - 300265215063.79 I get :
My code gives : ED4463C84DE9D21B54C4E62F2D72CE
An online MD5 hash gives : 0ed40463c84de9d21b54c4e62f2d72ce
Which apart from the case, is exactly the same apart from missing 2 zeroes.
View 1 Replies