You must Sign In to post a response.
  • Category: ASP.NET

    How to fill the textbox value while page is postback in vb.net

    Hello Sir

    I have a DataGrid and i want to keep the value of text box while paging (pageIndex_Changed) Occur.
    I have used dataset for fill the datagrid, Can you pelase suggest on this ?

    Thanks,
    Bhavik Shah
  • #767144
    Hi,

    As per my understanding you have textbox inside gridview and you made changes in textbox and while moving from one page to another you are loosing the data this is what your problem right?

    If this is your problem, my suggestion is rather than bind the gridview based on dataset; store the dataset result into ViewState and bind the gridview using ViewState object,

    and while click on next page you can update the data into viewstate and rebind your grid using ViewState object.

    If my understanding is wrong, please elaborate your requirement so that we can help you better.

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #767149
    Hello Sir
    Thanks for your valuable comments and its work fine now i want to display confirm message while paging is occurred
    Can you please suggest on this Thanks in advance

    Bhavik Shah

  • #767152
    Hi,

    If you want to show confirmation message while paging then you have to design your gridview in the same manner, example in your case you want to show the confirmation while paging time so I include one unique class for pagerstyle of gridview template.

    EX:

    <asp:GridView ID="gv" runat="server" DataKeyNames="ID" PageSize="1" AllowPaging="true" OnPageIndexChanged="gv_PageIndexChanged">
    <Columns>
    </Columns>
    <PagerStyle CssClass="pager" />
    </asp:GridView>



    use the below jquery to show the confirmation message using class name


    $(document).ready(function () {
    $('.pager a').click(function () { Confirm('paging'); });
    });


    Hope this will helpful to you...

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/


Sign In to post your comments