Form View page redirect - c#

I am using a FormView to display data with a SqlDataSource and my platform is MSVS2013.
Lets say I have 4 data in Data table so it displays fist data set with page numbers at the bottom.
But if I select 2nd or 3rd on any other page number then it will refresh the page and set proper data in the FormView. The problem is if I select any other page number it will change data and not navigate view back to same position to the page, instead it shows the top position of the page.
Can any one help Thanks in advance!

Use update panel... it will give the solution

Related

How to send current page number of jQuery Datatables to controller action method MVC C#

I am binding my data using Datatables. I have edit and delete button on every row. Clicking edit will navigate to edit view.
After saving the data in edit view, it is navigated to index view to the first page of the DataTable.
I want it to navigate to the updated row or atleast to the page where the updated row is in rather than going to the first page.
Please help me with this.
test with stateSave property of datatable
$('#example').dataTable( {
stateSave: true
} );

How to keep textbox value and gridview value after Edit gridview record page navigation

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.

Reverse Repeater Order asp.net /c#

i'm working on items page where user can insert items into system and all items shown in repeater in the home page ,the latest items are displayed on the bottom of the page whilst the first items are displayed on the top ,
Is there a way to reverse the order such that the latest updates in the repeater are always displayed on top ?
Have you tried this?
Repeater.DataSource = data.Reverse();
Repeater.DataBind();

Is partial page reload possible in asp.net?

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

Displaying image on a different page

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.

Categories

Resources