Ask a Question related to ASP.NET Building Controls, Design and Development.
-
Jean Erasmus #1
LoadViewState does not fire on a postback event
Hi there,
I need some help please. I have created a composite control that have a
collection of items associated with it. Now I want to save this to the view
state of the control, but the LoadViewState method does not get called so I
can get the collection out of the view state.
Does anybody have any idee why this is happening?
Regards,
Jean
Jean Erasmus Guest
-
composite control does not fire event
Hi I have an aspx-page, where I load my custom-control (see below). The problem I have is that the event does not fire. I really cant figure out... -
datagrid linkbutton will not fire Postback at random times
I have a simple linkbutton in a datagrid that works 99.99% of the time. At random times (4 times in the past year) with non-specific data records, a... -
Checkbox in Datagrid doesn't fire event
I've added a Checkbox control to a Datagrid and would like to Enable/Disable a button based on whether the checkbox is checked. However, I'm trying... -
Bug in _EditCommand, event didn't fire? +my solution
Hello, I had a problem that the _EditCommand didn't fire when the event was created in the .vb code. I did like this: 1. I created a datagrid... -
how to fire a postback event
Hi, All I design a composite custom control, which has three dropdownlists in it. I find as long as one of the dropdownlist control's id is... -
Victor Garcia Aprea #2
Re: LoadViewState does not fire on a postback event
Hi Jean,
A very common cause for viewstate to not be loaded it late addition to the
control tree. Is your composite being added dynamically or is it declared at
design-time? What about its childrens?
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
[url]http://obies.com/vga/blog.aspx[/url]
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
"Jean Erasmus" <jeane@trenstar.co.za> wrote in message
news:O1LgCR0sDHA.2252@TK2MSFTNGP09.phx.gbl...view> Hi there,
>
> I need some help please. I have created a composite control that have a
> collection of items associated with it. Now I want to save this to theI> state of the control, but the LoadViewState method does not get called so> can get the collection out of the view state.
>
> Does anybody have any idee why this is happening?
>
> Regards,
> Jean
>
>
Victor Garcia Aprea Guest
-
Jean Erasmus #3
Re: LoadViewState does not fire on a postback event
Hi Victor,
I found the problem. I was using an inherited page class, and the control
was being loaded before the base.OnInit was called.
Regards,
Jean
"Victor Garcia Aprea" <vga@obies.com> wrote in message
news:%23Cov2a9sDHA.1884@TK2MSFTNGP10.phx.gbl...at> Hi Jean,
>
> A very common cause for viewstate to not be loaded it late addition to the
> control tree. Is your composite being added dynamically or is it declaredso> design-time? What about its childrens?
>
> --
> Victor Garcia Aprea
> Microsoft MVP | ASP.NET
> Looking for insights on ASP.NET? Read my blog:
> [url]http://obies.com/vga/blog.aspx[/url]
>
> To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
> "Jean Erasmus" <jeane@trenstar.co.za> wrote in message
> news:O1LgCR0sDHA.2252@TK2MSFTNGP09.phx.gbl...> view> > Hi there,
> >
> > I need some help please. I have created a composite control that have a
> > collection of items associated with it. Now I want to save this to the> > state of the control, but the LoadViewState method does not get called> I>> > can get the collection out of the view state.
> >
> > Does anybody have any idee why this is happening?
> >
> > Regards,
> > Jean
> >
> >
>
Jean Erasmus Guest
-
Unregistered #4
Re: LoadViewState does not fire on a postback event
// I added this SaveViewState event. and after post back the LoadViewState will be called.//
//Working fine now.
protected override object SaveViewState()
{
ViewState["MyKey"] = "My Value";
Response.Write("SaveViewState <br>");
return ViewState["MyKey"];
}
protected override void LoadViewState(object sender)
{
Response.Write("LoadViewState <br>");
}
protected override void LoadViewState(object sender)
{
Response.Write("LoadViewState <br>");
}Unregistered Guest



Reply With Quote


