Click here to Skip to main content
15,902,938 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: distribute the application Pin
Sandeep Akhare10-Oct-07 20:08
Sandeep Akhare10-Oct-07 20:08 
GeneralRe: distribute the application Pin
Aavesh Agarwal10-Oct-07 20:11
Aavesh Agarwal10-Oct-07 20:11 
QuestionHashTable getting null between requests Pin
C.Sharp.Mage10-Oct-07 14:14
C.Sharp.Mage10-Oct-07 14:14 
AnswerRe: HashTable getting null between requests Pin
Christian Graus10-Oct-07 14:19
protectorChristian Graus10-Oct-07 14:19 
GeneralRe: HashTable getting null between requests Pin
C.Sharp.Mage10-Oct-07 14:28
C.Sharp.Mage10-Oct-07 14:28 
GeneralRe: HashTable getting null between requests Pin
Christian Graus10-Oct-07 14:35
protectorChristian Graus10-Oct-07 14:35 
GeneralRe: HashTable getting null between requests Pin
C.Sharp.Mage10-Oct-07 16:56
C.Sharp.Mage10-Oct-07 16:56 
Questionhiddenfield living out of scope? [modified] Pin
KBTibbs10-Oct-07 9:25
KBTibbs10-Oct-07 9:25 
My ASP.NET page generates some HTML, then sticks it into a hiddenfield so a javascript can access it and write it to a popup window.

I had to disable validation for this page, as HTML inside a field triggers ASP.NET's cross-site scripting security.

Now, this was all working well and good until I changed my navigation menus from plain images and anchors to ASP:imagebuttons. The navi menu is on my masterpage and in now within the same block as the contentplaceholder. This is the only change I've done.

Now, when I click a button to go to a different page, all of my pages trigger the ASP.NET cross-site scripting security because of the hiddenfield on a single page.

Now, to try and fix this, I've set the hiddenfield's viewstate to false. I hope this would stop it from posting back, to no avail. Also, I've added the following event:

protected void reportField_Unload(object sender, EventArgs e)<br />
{<br />
    reportField.Value = "";<br />
}



But still, the security is tripped. It seems like this hiddenfield is living way outside it it's scope... why?


-- modified at 16:05 Wednesday 10th October, 2007

Edit:

It seems the hiddenfield isn't living too long, it's just that its life is long enough to reach the other page's request validation.

So, it occurs to me that I can disable request validation with

<% Page ValidateRequest="false"%>

and then call Request.ValidateRequest() in the page's OnLoad event. The hiddenfield should be expired by then, and we still get input validation early enough for security, yes?
Questionhow to access basepage methods from masterpage?? Pin
lnong10-Oct-07 8:56
lnong10-Oct-07 8:56 
AnswerRe: how to access basepage methods from masterpage?? Pin
Christian Graus10-Oct-07 9:14
protectorChristian Graus10-Oct-07 9:14 
QuestionAdd row to Gridview Pin
kjosh10-Oct-07 6:39
kjosh10-Oct-07 6:39 
AnswerRe: Add row to Gridview Pin
Aavesh Agarwal10-Oct-07 16:41
Aavesh Agarwal10-Oct-07 16:41 
AnswerRe: Add row to Gridview Pin
Dhyanga11-Oct-07 0:01
Dhyanga11-Oct-07 0:01 
AnswerRe: Add row to Gridview Pin
firozu11-Oct-07 0:30
firozu11-Oct-07 0:30 
QuestionFaster Dynamic Compilation Pin
MacManzo10-Oct-07 6:16
MacManzo10-Oct-07 6:16 
QuestionClicking in a datagrid row anywhere and on postback retreiving a cell value Pin
SandeepkKumbhar10-Oct-07 5:15
SandeepkKumbhar10-Oct-07 5:15 
AnswerRe: Clicking in a datagrid row anywhere and on postback retreiving a cell value Pin
N a v a n e e t h10-Oct-07 18:15
N a v a n e e t h10-Oct-07 18:15 
GeneralRe: Clicking in a datagrid row anywhere and on postback retreiving a cell value Pin
SandeepkKumbhar10-Oct-07 18:32
SandeepkKumbhar10-Oct-07 18:32 
QuestionASP.Net IDE general questions.. Pin
Dio2210-Oct-07 5:11
Dio2210-Oct-07 5:11 
AnswerRe: ASP.Net IDE general questions.. Pin
scicorp10-Oct-07 7:25
scicorp10-Oct-07 7:25 
QuestionAccess GridView's full data table Pin
GreenGiant8310-Oct-07 3:39
GreenGiant8310-Oct-07 3:39 
AnswerRe: Access GridView's full data table Pin
GreenGiant8310-Oct-07 5:49
GreenGiant8310-Oct-07 5:49 
Questionunable to run xp_cmdshell from inside a stored procedure Pin
MissionSuccess10-Oct-07 3:33
MissionSuccess10-Oct-07 3:33 
AnswerRe: unable to run xp_cmdshell from inside a stored procedure Pin
kubben10-Oct-07 4:58
kubben10-Oct-07 4:58 
GeneralRe: unable to run xp_cmdshell from inside a stored procedure Pin
MissionSuccess10-Oct-07 19:13
MissionSuccess10-Oct-07 19:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.