Saturday, March 31, 2012
Submitting IFrame in asp.net
I have this situation where I need to do some server side execution
without posting the page.
I used to do this in asp using IFrame, but it's not working in asp.net.
I had a form and iframe element in the web page as follow:
<form id=MainForm ...>
this is the form that the user see
</form>
<form id= myForm method=post action="form.aspx" target="myHiddenFrame">
<input type=hidden id=hiddenField>
</form>
<iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
style="width:0px; height:0px; border: 0px"></iframe>
then I had a javascript function: window.myForm.submit();
It seems that i can't put target="myHiddenFrame", the target can only be
_self, _parent...
How can I submit in an IFrame element ?
regards
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!iframe is working in asp.net in the regular way. It just has to sit inside a
form. And there can be only one form in a page. And there should be
runat=server set for the form tag.
Eliyahu
"Naim" <anonymous@.devdex.com> wrote in message
news:%23YXooBz7EHA.3592@.TK2MSFTNGP09.phx.gbl...
> hi
> I have this situation where I need to do some server side execution
> without posting the page.
> I used to do this in asp using IFrame, but it's not working in asp.net.
> I had a form and iframe element in the web page as follow:
> <form id=MainForm ...>
> this is the form that the user see
> </form>
> <form id= myForm method=post action="form.aspx" target="myHiddenFrame">
> <input type=hidden id=hiddenField>
> </form>
> <iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
> style="width:0px; height:0px; border: 0px"></iframe>
> then I had a javascript function: window.myForm.submit();
> It seems that i can't put target="myHiddenFrame", the target can only be
> _self, _parent...
> How can I submit in an IFrame element ?
> regards
>
> *** Sent via Developersdex http://www.examnotes.net ***
> Don't just participate in USENET...get rewarded for it!
Submitting IFrame in asp.net
I have this situation where I need to do some server side execution
without posting the page.
I used to do this in asp using IFrame, but it's not working in asp.net.
I had a form and iframe element in the web page as follow:
<form id=MainForm ...>
this is the form that the user see
</form>
<form id= myForm method=post action="form.aspx" target="myHiddenFrame">
<input type=hidden id=hiddenField>
</form
<iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
style="width:0px; height:0px; border: 0px"></iframe
then I had a javascript function: window.myForm.submit();
It seems that i can't put target="myHiddenFrame", the target can only be
_self, _parent...
How can I submit in an IFrame element ?
regards
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!iframe is working in asp.net in the regular way. It just has to sit inside a
form. And there can be only one form in a page. And there should be
runat=server set for the form tag.
Eliyahu
"Naim" <anonymous@.devdex.com> wrote in message
news:%23YXooBz7EHA.3592@.TK2MSFTNGP09.phx.gbl...
> hi
> I have this situation where I need to do some server side execution
> without posting the page.
> I used to do this in asp using IFrame, but it's not working in asp.net.
> I had a form and iframe element in the web page as follow:
> <form id=MainForm ...>
> this is the form that the user see
> </form>
> <form id= myForm method=post action="form.aspx" target="myHiddenFrame">
> <input type=hidden id=hiddenField>
> </form>
> <iframe id="myHiddenFrame" src=PortfolioName.aspx name="myHiddenFrame"
> style="width:0px; height:0px; border: 0px"></iframe>
> then I had a javascript function: window.myForm.submit();
> It seems that i can't put target="myHiddenFrame", the target can only be
> _self, _parent...
> How can I submit in an IFrame element ?
> regards
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Monday, March 26, 2012
Suggestion for the new .NET documentation
I have a suggestion for the new .NET documentation.
In some newsgroup I read a posting from Anand Hegde from Microsoft. He stated that the disabling of events like PageIndexChanged on a DataGrid, when ViewState on it (or it's container) is disabled, is by design.
This is not, or very poorly, documented and I was unable to find it in the docs. Some places this should really be noted (or at least directly linked to!) is the DataGrid.ViewState documentation as well as the documentation of the other properties and events that are dependent on it.
Regards,
David van LeerdamI don't think that PageIndexChanged is disabled when viewstate is disabled, but you do have to take special steps to get paging to work properly.
See this articlePutting the DataGrid on a Diet by yours truely.
In the current version of the DataGird, the viewstate of the page must be enabled if the DataGrid's paging should work. The paging uses the viewstate to store the index of the selected page. The OnPageIndexChanged event will still be executed even if the viewstate is disabled on the page, but the page index will always be set to zero. In Whidbey the page viewstate could be disabled but the DataGrid's view state must be enabled (it's enabled by default). There is a new state (control state) for controls added to Whidbey that will let control hold their sate and will not be affected if the page viewstate is disabled.
As I mentioned in another thread, I was able to successfully port to Whidbey my demo application that shows how to do paging, sorting and selected items in a grid that has viewstate = False. The solution proposed does require that the page have viewstate enabled. The basic approach is to disable viewstate for the grid, but store current page, sortfield, selected item in the page's viewstate. I re-bind the grid on each postback, after restoring these values. I do successfully receive appropriate values for the new page index, but have to save it immediately.