Web Forms :: Refresh Page Only When EmptyDataTemplate Is Used?
Jan 11, 2011
Following is some code-behind for a ListView I'm using. Specifically, as the name of the procedure implies, it runs after an image is uploaded and, among other things, saves it to a folder in the project and puts the file name and path in a database table. This all occurs with a button click in either the ItemTemplate or the EmptyDataTemplate. The ItemTemplate updates itself but the EmptyDataTemplate isn't as well-behaved so I have to do a page refresh.
[Code]....
This is all fine and good but I would rather not refresh the page if I'm not operating from EmptyDataTemplate. What would be a good IF statement before the "Response.Redirect(Request.Url.AbsoluteUri)"? It should instruct the page to refresh only when it comes from the EmptyDataTemplate. I've tried all the EditIndex settings I could think of--not sure if the solution should be along those lines or something else.
View 10 Replies
Similar Messages:
Apr 9, 2010
I often have some controls (like TextBoxes) for input parameters at the top of a page followed by a ListView to show the results.
When submit is hit, the LIstView shows the results using ControlParameters in the SqlDataSource.
My problem is when you first navigate to the page, the EmptyDataTemplate is shown. This can confuse users.
What is the Best Practice for not showing the ListView or EmptyDatatemplate until there has been a Submit button press?
View 3 Replies
Nov 3, 2010
I have a table on my page. I need to scroll down a little to get to that table. In that table i have som data that i edit and save to database. When the save is done i need to refresh the page( Response.Redirect(Request.RawUrl )) so it loads the new data to that table. When the refresh is done the page is on top again so that i need to scroll down again to see the table. This makes it very unusable for the user.
How can i refresh the page without it going back to top again? I tryed wrapping an updatepanel around the table but it didnt
View 1 Replies
Jan 18, 2010
1. Is there anyway to make an ifrom refresh without having to refresh the whole page?
2. My iframe just wont display when I run it. It just displays a grey screen with the file name in the middle.
<
iframe
runat="server"
id="IframeOne"
src="~/Test.aspx"></iframe>
View 3 Replies
Jun 13, 2010
is it possible to access public page variables from ListView.EmptyDataTemplate ?
View 1 Replies
Mar 11, 2011
how we can refresh small part of the web page without refresh the entire page in C# ?
View 2 Replies
Feb 10, 2010
Is there a Page.Refresh type of Command to refresh a page? I don't want to redirect to the page or refresh in javascript.
View 4 Replies
Feb 2, 2010
how can you create a "EmptyDataTemplate" in a repeater?
View 2 Replies
Nov 15, 2010
how can go to next page in gridview without refresh page
i thing programmers says wihtout postback?
View 1 Replies
Sep 30, 2010
I have a page that is opened in a popup window from the main page. Once i click insert it pops up a message that says you have successfully added blah blah. Then once you click ok it closes the popup page and goes back to the main page. I want to be able to refresh the main page back to how it was when you first land on the page. Here is the code for my insert button:
[Code]....
View 26 Replies
Feb 12, 2013
I have an image uploader in admin panel of my website. That uploaded image is shown in some user page. Now, when i open the user page in a tab & the admin page containing the image uploader in another tab and then upload the image here and save it, it should automatically refresh the user page in the tab already opened but should not disturb the page that am currently now.
View 1 Replies
Jul 30, 2010
The situation: a FormView with an EditItemTemplate and an Insert Item Template. When the page is entered and a record exists in the datasource, everything is fine with the Formview in Edit mode and the Edit ItemTemplate being used. But when no record is present, the FormView uses the EmptyDataTemplate even though it was switched it to Insert mode. Here is the code used to switch modes, fired in the OnDataBound event:
protected void SetModeAndHeadings(object sender, EventArgs e)
{
if (FormView1.DataItemCount == 0)
{
FormView1.ChangeMode(FormViewMode.Insert);
}
else
{
FormView1.ChangeMode(FormViewMode.Edit);
}
etc...
}
Is the problem that it switched to Insert mode too late? What has to be done differently here to automatically switch between Edit and Insert modes?
View 2 Replies
Oct 27, 2010
i want to disable some buttons in my emptydata template. i tried using this code but it cant find the control. thus returning an error Specified argument was out of the range of valid values.
Button btnsaveini = (Button)grdNonSerialized.Controls[0].Controls[0].FindControl("btnSave1");
btnsaveini.Enabled = false;
View 3 Replies
Jul 6, 2010
There is user selected search criteria used to display both a FormView (Invoice header information such as ship_id, vendor, date, store, etc...) and cooresponding GridviewDetails (product details such as upc, description, unit cost, qty ordered, qty received, etc...) There is a one to many relationship between 1 invoice (formview) and many product details (gridview). I need to add the ability to insert product details to a particular invoice (ship_id is the link between the 2 tables) if an invoice currently doesn't have any. I have the emptydatatemplate programmed with dropdownlists and textboxes to capture the user entered information along with a submit button. However the insert doesn't occur.
I know the problem is how I am (incorrectly) using the findcontrol, but for the life of me I can't seem to find the correct syntax (been searching the forums for nearly a weeks implementing different syntax and testing to no avail!)
I have successfully implemented the ability to insert a new row using the footertemplate and was banking on some of that code to assist me with the insert of new details in the emptydatetemplate. Grrrrr....still not working. Below is the current version of the test page programming.
Code behind for the OnClick button in the emptydatatemplate "submit": (note: I know at least part of the problem is in how I am attempting to find the controls. Here is where I can not find a syntax that works and I have tried several dozen versions...)
[Code]....
GridviewDetails EmptyDataTemplate programming is below:
[Code]....
I've also included my entire GridViewDetails programming just in case it helps to read what it is that I am trying to do:
[Code]....
And here's the entire code behind that I have so far to make everything else function as desired:
[Code]....
View 3 Replies
Apr 28, 2010
Could someone please point me to a tutorial that explains how to add new records in the ListViews EmptyDataTemplate
View 1 Replies
Oct 1, 2010
All the writeups on ListView's EmptyDataTemplate say that it's for displaying the fact that no data records exist, which is logical; but the bad thing is that I've found nothing as a follow-up. In other words, I haven't been able to find any "now what?" once you (as the site user) find that there aren't any data records. I am led to then ask what the real purpose of the EmptyDataTemplate is if you can't do anything with it.
I added a button called "Add Your Photo" on the EmptyDataTemplate, which activates a ModalPopupExtender with an AsyncFileUpload. All this works fine in terms of uploading the file but nothing happens after that. I wonder if I should be starting instead in the InsertItemTemplate.
So, I need to know how to accomplish a couple of options: I need to start out in either the InsertItemTemplate or the EmptyDataTemplate. If I do the latter, I will need to know how to get from there to the ItemTemplate so the rendering can be displayed.
What code should I use to display the data--that is, how do I move from the EmptyDataTemplate to the ItemTemplate?
View 19 Replies
Jun 9, 2010
I can't seem to get either EmptyDataTemplate or EmptyDataText of a GridView to work. I'm fetching the GridView contents in de codebehind and attaching them with using DataBind(). I've tried having them as null and as an empty List, and in both cases the text I put intoEmptyDataTemplate or EmptyDataText is not displayed. What am I doing wrong?
EDIT (Code snippet) This is my GridView:
<asp:GridView ID="grid" runat="server" EmptyDataText="EMPTY"></asp:GridView>
And I've tried these two for binding the data:
grid.DataSource = new List<object>();grid.DataBind();grid.DataSource = null;grid.DataBind();
View 5 Replies
Nov 4, 2010
There is a page having formview with inserttemplate loading after user authentication. I have created user id = guest. If anyone login with guest i want to be load page FormView with EmptyDataTemplate.
View 11 Replies
Aug 17, 2010
I have a grid view (using sqldatasource & C#) which returns no rows. By design asp.net does not show header/footer. I looked at couple of sites and suggestions and found it to be too complex. Nothing was simple. The one I found was to create a empty datatable, insert rows and bind it to the gridview. But that code does notwork for me because I am using sqldatasource and using datatable gives error.I decided to just add the following to empty item template.
<EmptyDataTemplate>
<div>
<asp:Label Text="No details found." runat="server"> </asp:Label>[code]....
THe link shows up in the bottom but the event gridview_RowCommand is not fired as the grid view is not created or it does not have rows
How do I call a function on click the add new link and put all my code in there to insert possibly using a modal popup. I cannot use onclientclick because it is javascript.
View 8 Replies
Feb 9, 2011
I have the following setup, but i would like to make the empty text more specific, so just looking to have it display the same message but with the selected value text from the drop down as part of the messages.
so if you select say the 2nd item from the drop down, then i would like to have the empty label(if empty of course) display "There are No Records for Last 24 hrs"
[Code]....
[Code]....
[Code]....
View 2 Replies
Jan 6, 2010
There have been a few datapaging questions tonight, but mine is a bit different..
I have a regular datapager, in a seperate project it seemed to work fine with the same query and templates, but when I use it in my page, whenever the I try to page I get the emptydatatemplate when there should be data..
Here is my current ListView
[Code]....
I have tried binding data OnPreRender and setting the page properties under the OnPagePropertyChanging events.. still only getting my empty template whenever i navigate through the pages when there should be plenty of data..
View 1 Replies
Jan 15, 2011
I have a DropDownList in the InsertItemTemplate of the DetailsView in EmptyDataTemplate. I want to acces the value of the DropDownList control and insert its value in the empty DataBase.
View 6 Replies
May 3, 2010
How to avoid page refereshment in masterpage while redirect current child page to another child page
View 2 Replies
Feb 10, 2011
I have 2 pages (test1.aspx & test2.aspx). I have one button in test1.aspx, on click of it, I am loading test2.aspx, like Response.Redirect("test2.aspx"). It refreshes the browser/ page and load test2.aspx.
What I have to do is, I have to load test2.aspx without any page/ browser refresh.
View 7 Replies
Jan 26, 2011
I have a page which has a grid to be modified at the end of the page. I have validations when modifying the values in the grid on text changed events and also button for edit and delete the rows on the grid.Everything works fine except the page refresh which takes to the top of the page each time i click on the button in the grid or when validation occurs.Please help me how to control the page to stay in the current position after refresh. I tried using the focus but then I don't feel that is not exactly what I am looking for. It only takes to the control but still the bottom part of the grid will not be visible and also if there are so many controls and events in the page, I cannot set the focus to every control which are below the grid.
View 1 Replies