Showing posts with label element. Show all posts
Showing posts with label element. Show all posts

Thursday, March 29, 2012

Please answer this question

Please answer this question
You are troubleshooting a deployed Web application and need to change the element to enable tracing on the page. You modify the Web.config file for the application. Which statements correctly describe when the change will be applied and its impact on current users? (Select all that apply.)
0 Current users will be immediately disconnected from the application.
0 Current users will be given a five-minute warning before the Web application is restarted.
0 State data stored in the Application object will be maintained.
0 State data stored in the Session object will be lost.
0 The Web application will be restarted and the configuration file will be read immediately.

Getting others to take your test (or do your homework) for you I see...
tisk tisk.

1) True, but they wont know it till they make a request again.
2) false
3) false
4) false
5) false. It will be "read" on the next request.

Please explain strange viewstate behavior...

I am dynamically adding an HtmlInputHidden element with different values.
The problem is the first time I add it with a given value and submit it then
change the value within the Page_Load event it still has the original value.
I am guessing this has something to do with viewstate. I have turned off
viewstate at the page level, but the issue still occurs. Any suggestions?
The code is basic:
HtmlInputHidden phihAction = new HtmlInputHidden();
phihAction.ID = "hdnAction";
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );
pactAction is an enumeration that changes based on action (i.e. 1=Add, 2=Edi
t)
Any help in understanding why it does what it does and how to work around it
would be greatly appreciated.
RobertRobert,
You need to check IsPostBack property befory assigning the value:
HtmlInputHidden phihAction = new HtmlInputHidden();
phihAction.ID = "hdnAction";
if (IsPostBack)
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );
Eliyahu
"rgrandidier" <rgrandidier@.discussions.microsoft.com> wrote in message
news:E0B96D78-C2B6-4A46-BE08-E7E7B7FD1893@.microsoft.com...
> I am dynamically adding an HtmlInputHidden element with different values.
> The problem is the first time I add it with a given value and submit it
then
> change the value within the Page_Load event it still has the original
value.
> I am guessing this has something to do with viewstate. I have turned off
> viewstate at the page level, but the issue still occurs. Any suggestions?
> The code is basic:
> HtmlInputHidden phihAction = new HtmlInputHidden();
> phihAction.ID = "hdnAction";
> phihAction.Value = ((short)pactAction).ToString();
> mfrmUser.Controls.Add( phihAction );
> pactAction is an enumeration that changes based on action (i.e. 1=Add,
2=Edit)
> Any help in understanding why it does what it does and how to work around
it
> would be greatly appreciated.
> --
> Robert

Please explain strange viewstate behavior...

I am dynamically adding an HtmlInputHidden element with different values.
The problem is the first time I add it with a given value and submit it then
change the value within the Page_Load event it still has the original value.
I am guessing this has something to do with viewstate. I have turned off
viewstate at the page level, but the issue still occurs. Any suggestions?

The code is basic:
HtmlInputHiddenphihAction = new HtmlInputHidden();

phihAction.ID = "hdnAction";
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );

pactAction is an enumeration that changes based on action (i.e. 1=Add, 2=Edit)

Any help in understanding why it does what it does and how to work around it
would be greatly appreciated.

--
RobertRobert,

You need to check IsPostBack property befory assigning the value:

HtmlInputHidden phihAction = new HtmlInputHidden();

phihAction.ID = "hdnAction";
if (IsPostBack)
phihAction.Value = ((short)pactAction).ToString();
mfrmUser.Controls.Add( phihAction );

Eliyahu

"rgrandidier" <rgrandidier@.discussions.microsoft.com> wrote in message
news:E0B96D78-C2B6-4A46-BE08-E7E7B7FD1893@.microsoft.com...
> I am dynamically adding an HtmlInputHidden element with different values.
> The problem is the first time I add it with a given value and submit it
then
> change the value within the Page_Load event it still has the original
value.
> I am guessing this has something to do with viewstate. I have turned off
> viewstate at the page level, but the issue still occurs. Any suggestions?
> The code is basic:
> HtmlInputHidden phihAction = new HtmlInputHidden();
> phihAction.ID = "hdnAction";
> phihAction.Value = ((short)pactAction).ToString();
> mfrmUser.Controls.Add( phihAction );
> pactAction is an enumeration that changes based on action (i.e. 1=Add,
2=Edit)
> Any help in understanding why it does what it does and how to work around
it
> would be greatly appreciated.
> --
> Robert