I have a page for searching when I write my name for example in textbox it will search and display the results in a GridView. I'm using an EntityDataSource with a QueryExtender so I didn't write any code in C#.
The problem is: in the GridView I have a hyperlink when I click it, it will go to another page, ok fine then when I return to the previous page the GridView does not show the results of the search when I was left because of the postback (update panel) it show the whole data from EntityDataSource.
I think I have to use session but I don't know how I can do it, I mean how I can save the GridView in session and how I can retrieve it in page_load.
Related
I have a web form which is basically a search form where user should be able to search records based on ID, Date and some other criteria. The search result will be then display on gridview. I have Edit functionality for each records on the gridview.
When user click on Edit of any record it will navigate to the edit page where user should be able to edit and update.
Everything works fine upto here.
But i have a back button on the Edit page once i click on the back page it will come back to the search page.
I want to keep the previously searched value on the textbox and the search result on the gridview too but i am not able to.
I tried both session variable and cookies but it is not working.
So please help me how can i do this??
Thanks for your suggestion.
I have a Gridview on a webpage which is populated with data fed from a XML file, the gridview also contains a checkbox column. I have another page which has a textbox placed on it. I require to send the selected rows from the gridview to the textbox on the other page by the click of a button.
The screenshot above is the gridview of the items being fed from an xml file. I require the checked rows of the gridview to be displayed in a textbox, which is displayed on another page of the web application, and this is to be done by clicking the 'Send Items' button. Could anyone help me with this?
I got 2 .aspx pages ,
page one(1) to insert data .....
page two(2) to view data using a gridview.
There's an edit button in the gridview , it will redirect the to page(1) and load the specific values to the textboxes, dropdowns according to the selected record.
Session is used to carry out the record from page(1) to page(2).
In the page load of page(1), if Session is not NULL it will load the values to the textboxes and etc.
My problem is , I have enabled Autopostback=true in one of the dropdowns,(to enable few more textbox's to appear when specific options are selected).
So when those options are selected page will be reloaded,when reloading it will load the specific values to the textboxes .... as the Session is not null. And the purpose of dropdown is not fulfilled because it keeps loading values to the textboxes , but not enabling the textboxes which i need to appear + the value of the selected dropdown doesnt get changed to the selected value as it loads values from the database to the dropdown too.
Any solutions ?
I sounds like you're looking for a partial postback solution.
The UpdatePanel should solve this for you:
http://www.encodedna.com/2013/02/aspdotnet.postback-updatepanel.htm
Hallo there
I have and imageField as part of a gridview and would like to know how I can view this image in a different page when I select the row with a button(field).
When I add the information to a database the imageUrl is added to the database and this I tie up with the name of an uploaded image and subsequently the image is displayed in the gridview.
Is it possible for me to display this image on a different web page as well
thanks
Instead of storing image in session, why not populate Session["ImageID"] value on Button click?
Set gridview's OnRowCommand property to a method that will set Session["ImageID"] to the current row's DataKey, then do a redirect to that other page that will get value from Session["ImageID"] and get image URL for that ID from database. Don't forget to also perform Session.Remove("ImageID"). That way you'll keep your session object as small as possible.
Yes ,you can , i think if you store the selected image information in a Session.May be, there are other ways , but the first thing comes in my mind in this case using the session.
i wrote a page which are several fields and there is gridview which keeps the data inserted bottom of the page and i added a updatepanel... when i click the insert double data inserting to grid how to prevent it...
Disable the button that users have to click to insert data to the grid.
Clear all the input fields.