Web Forms :: Page Refresh Not Working After Inserting Records Into Database

Oct 28, 2012

I've a function named fillgrid() which fills the grid with data.This function works correctly on pageload,but after inserting into database i've called this function again, which is not getting executed.This issue happens only in real time server not in my local system,I'm not getting any error and i cannot recognize why fillgrid() function is not getting called??I've used update panel.This is the code for insert function which inserts over 500records.

DataTable dtMob = new DataTable();
dtMob = dtMobilizn.Copy();
DataSet dsMobilizn=new DataSet("dsMobilization");

[code]....

View 1 Replies


Similar Messages:

Web Forms :: Inserting Multiple Records In Database

Apr 5, 2010

I am having 3 textboxes where I am inserting 3 employee names.I want to insert these details into database as 3 different records.Pls respond me ASAP

View 7 Replies

Web Forms :: Why Doesn't Inserting Records In Newsletter Database Not Succeeding

Mar 8, 2010

i'm making a application for a newslettersystem. The only thing i want yet is to subscribe to a elecronic newsletter, but the record to subscribe isn't inserting. What do i do wrong?

[Code]....

and the vb code

Protected Sub btn_verwerken(ByVal sender As Object, ByVal e As System.EventArgs)
Dim strConnectie As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("~/App_Data/nieuwsbrief.mdb")
Dim Connectie As New OleDbConnection(strConnectie)
Try
Connectie.Open()
Dim strSQL As String = "INSERT INTO TBL_Subscribers(Email, SubscribeDate, ActivateDate, UnsubscribeDate) VALUES (@Email, @SubscribeDate, @ActivateDate, @UnsubscribeDate)"
Dim command As New OleDbCommand(strSQL, Connectie)
command.Parameters.AddWithValue("@Email", Emailadres.Text)
command.Parameters.AddWithValue("@SubscribeDate", DateTime.Now)
command.ExecuteNonQuery()
Connectie.Close()
Response.Write("inserted")
Catch ex As Exception
MsgBox(ex.Message.ToString, MsgBoxStyle.Exclamation, "BCT")
End Try
End Sub

View 5 Replies

Web Forms :: How Stop Saving / Inserting If Refresh The Page

Jun 30, 2010

I am using an application called "SAFE" from ASP. This application using for enter the aircraft and personal injury accident.

Once we enter all the details and click the submit button. The next page will open and show the message details like report number.

Report Number will generate depend on sequence.

If you press F5 or refresh in the same page, get the pop up message "Retry" or "Cancel".

If click the retry button, the same input details is saving and generating the next sequence report number.

View 2 Replies

Forms Data Controls :: Checking For Duplicate Records In Gridview Before Inserting To Database?

May 10, 2010

I need to check for duplicate records before inserting them into the SQL database.Thus I have the following codes:

For count = 0 To GridView1.Rows.Count
If (GridView1.Rows(count).DataItem("Student Name").Equals(dtDataTable.Rows(count).Item("Student ID"))) Then
lblMsg.Text = "Records Existed"
End If

but there are error message. "Object variable or With block variable not set."

View 11 Replies

Forms Data Controls :: How To Open A Page When Inserting Records From Detailsview

Mar 15, 2010

I've looked all over for this problem but can't find anything that works. I have a details view bound to a database that when a user enters their details and clicks insert it will store the data and then send them to another page. I have tried response.redirect but that does nothing. I am using c# btw.

View 9 Replies

Inserting Records From Multiple Computers In The Same Database At The Same Time In SQL Server 2005?

Nov 12, 2010

I have a web portal designed in ASP.NET in which we ask customers to enter the data. On the click of submit button all i have done is, just read the data and called a stored procedure which inserts that into a table. There seems to be a problem in SQL Server 2005 while inserting the data from multiple computers at the same time. We have tested in our lab with three computers, result is that we get the data inserted successfully in only one machine and on the other two machines we get error on page. I have used transactions in the stored procedure and also tried setting the isolation levels to READ_UNCOMMITTED, SERIALIZABLE and SNAPSHOT. Nothing seems to work properly.

View 4 Replies

Intercept Manual Refresh In Inserting Db Action Page?

Oct 22, 2010

i have a e-commerce page which send data to last page for the payment...

In this last page, the user confirm his intention to acquire products .... In this moment, i've created a sub which insert a new order in the database...all works!...

The problem born when i try (and user could too) to manually refresh the page...the code will be processed again and a new (second) order will be inserted in the database.....it's not correct...

This page make a postback after confirm button....so control page.ispostback will not resolve problem...

How could i intercept manual refresh of this page in a secure way ?

View 7 Replies

DataSource Controls :: Formview Insert - Stopping Page Refresh Inserting Data Again?

Jun 14, 2010

I have created a simple dataset with my ObjcetDataSource to my SQL table named Invoices and a new FormView. My form inserts are working 100% correctly, however after some testing i noticed the insert happens again if i hit the refresh button on my browser after an initial insert. I am currently submitting the form back to itself with a success/fail message returned on the page so that the user can keep inserting more records if they choose. This is done in my Inserted behaviour.

In my ObjectDataSource_Inserting code i am setting the values of a date prior to my insert. How do i stop a second INSERT from happening when the user refreshes the browser? I thought it was what IsPostBack was used for? Here is my code:

[Code]....

View 2 Replies

Forms Data Controls :: Stop FormView Inserting SQL Data Again On Page Refresh?

Jun 15, 2010

I am using an ObjectDataSource in my FormView for INSERT.

Data inserts correctly to my backend SQL table, however as i am posting back a success/fail message to the same page, i have noticed that after a successful INSERT if it hit the Refresh button the INSERT is doubled up.

How can i stop a user pressing the Refresh button and doubling the INSERT?

Is there a setting somewhere or can i stop this programmatically within my ObjectDataSource_Inserting method perhaps?

View 3 Replies

Web Forms :: Javascript On RadioButtonlist Not Working On Page Refresh?

Mar 2, 2011

I have used a radiobuttonlist to enable/disable the textbox in Grid View. I did this using javascript onclick event.

[Code]....

It is working fine when the page get refreshed too.

[Code]....

Then in a scenario, I have removed the radliobuttonlist items (items 2 and 3) dynamically. For the first time when its loaded its working without flaws. After a page is refreshing due to any serverside events, the javascript to enable/disable textbox is not working.

[Code]....

I have verified the HTML file, the radiobuttonlist is loaded without the onclick event.

View 1 Replies

Web Forms :: Inserting To Database On Submit The Page Goes Blank?

Sep 1, 2010

I'm trying to insert few values to a table, when i press the submit button the aspx page goes blank and i don't get any error message. I'm not able to find where the error is.

The code:

Protected Sub AddMInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddMInfo.Click

View 5 Replies

Web Forms :: Why SPROC Inserting Two Records Instead Of One

Oct 13, 2010

Why am I getting two records inserted into the table, when I'm expecting and needing one? The VB code below is checking whether the HTTP is secure or not, and if it is then execute the SPROC. But for whatever reason, I'm getting two records inserted about 5 seconds apart. Does anyone know why and how to fix? I just need one record.

SPROC [Code]....

VB [Code]....

GLOBAL.ASAX [Code]....

View 4 Replies

Web Forms :: Refresh In Page Replicates Data In Database?

May 10, 2010

I have a button that persist data in my database.

If I press button F5 to refresh my page, datas are duplicate.

How I can to fix this problem?

View 2 Replies

Web Forms :: How To Refresh Page And Fetch Information From Database

Aug 9, 2010

Split of from [URL]

tel me some code to refresh my asp page automatically after say 40 minutes to fetch latest data from database.

View 3 Replies

Web Forms :: Page Refresh And Values From Database Repeating

May 3, 2013

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

[Code] ....

Whenever I refresh the page the value from database update automatically even when i am not inserting 

Database table

Id in primary key 

Name nvarchar max 

Message nvarchar max

View 1 Replies

Page Refresh And Bind Not Working?

Jan 3, 2010

I've got a .aspx and in it an .ascx. In the .ascx I have a server control.

The .aspx has a list of items in a cart The .ascx has a list of some cross-sell items (fed from a custom server control) that the customer can add to the cart if desired both the list of items in cart and list of cross sell items are driven by a repeater and bound on page load. So the .aspx calls a method that rebinds the cart items on page load. And the .ascx calls a method in its page load that rebinds the cross sell items in that custom control (.cs) that is in my .ascx.

The problem I have is, when the user clicks a "add to cart" button in the repeater inside my custom control, the page refreshes and what should happen is the cart items in the .aspx AND the list of cross sells should refrsh showing that the cross sell item was moved to the cart. But even though when I debug and I see the list being rebound with the corret # of items after the move, the page still shows the old state. I have to refresh the page manually again to get it to work.

I guess I need to check for Page.IsPostback? but even if I don't check that..at the least both lists should be refreshing regardless cause I have it in my page load. So even if it's a postback, and I'm not checking for that the lists should show the new state because I'm not even checking for postback anyway. So checking for postaback I don't think is the issue here cause i want the lists to rebind and re-update on any page load....initial or if it's a postback...it doesn't matter. Reload every time. But it doesn't seem to be doing this even though I clearly see the revbind of the lists having the right count (one less on the cross sell and one additional to the cart as it was added after the user clicked the button).

Here's the sequence of events:

User is on their cart page User sees a list of cart items that they have added to their cart already (this list is bound in the Cart.aspx and rebound on every page load)User sees a list of possible cross sell items they can add to their cart somewhere on the page. This list is a custom control found in my .ascx and that .ascx is obviously in my .aspx.

The custom control is just a repeater that lists out the cross sell itemsUser clicks one of the "Add to cart" buttons on one of the cross sells Page refreshes. In the page load of the .aspx AND the .ascx, I am going out to the DB and rebinding both those lists based on the new state...that is, the new lists after the item was added to the cart which means that now the cart items should have one more added to the list and it does...I clearly see that the new list has one more.

The page comes back after the refresh but I don't see the lists reflecting the new state...I don't see the new item in the cart items list and the added cross sell removed from the cross sell list even though again both lists when I debug are showing correct set of records reflecting the new state.

View 2 Replies

Refresh Page Isn't Working Using Treeview

May 30, 2010

I am trying to refresh an asp.net page using this command:

<meta http-equiv="Refresh" content="10"/>

On that page I have 2 treeviews. The refresh works ok when I just open the page, but when I click on one of the treeviews and expand it, the refresh stopps working and the page isnt being refreshed. Is there any connection to the treeview being expanded? Here is the full code of the page:

public partial class Results : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
// Function that moves reviewed yellow card to reviewed tree
protected void ycActiveTree_SelectedNodeChanged(object sender, EventArgs e)
{
ycActiveTree.SelectedNode.Text = "Move To Active";
ycReviewedTree.PopulateNodesFromClient = false;
ycReviewedTree.Nodes[ycReviewedTree.Nodes.Count - 1].ChildNodes.Add(ycActiveTree.SelectedNode.Parent);
Application["reviewedTree"] = new ArrayList();
int count = ((ArrayList)Application["activeTree"]).Count;
// Move all the nodes from activeTree application to reviewedTree application
for (int i = 0; Application["activeTree"] != null && i < count; i++)
{
((ArrayList)Application["reviewedTree"]).Add(((ArrayList)Application["activeTree"])[i]);
((ArrayList)Application["activeTree"]).RemoveAt(0);
}
}
protected void ycActiveTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (Application["idList"] != null && e.Node.Depth == 0)
{
string[] words = ((String)Application["idList"]).Split(' '); // Yellow Card details
TreeNode child = new TreeNode("");
// Go over all the yellow card details and populate the treeview
for (int i = 1; i < words.Length; i++)
{
child.SelectAction = TreeNodeSelectAction.None;
// Same yellow card
if (words[i] != "*")
{
// End of details and start of point ip's
if (words[i] == "$")
{
// Add the yellow card node
TreeNode yellowCardNode = new TreeNode(child.Text);
yellowCardNode.SelectAction = TreeNodeSelectAction.Expand;
e.Node.ChildNodes.Add(yellowCardNode);
child.Text = "";
}
// yellow card details
else
{
child.Text = child.Text + words[i] + " ";
}
}
// End of yellow card
else
{
child.PopulateOnDemand = false;
child.SelectAction = TreeNodeSelectAction.None;
// Populate the yellow card node
e.Node.ChildNodes[e.Node.ChildNodes.Count - 1].ChildNodes.Add(child);
TreeNode moveChild = new TreeNode("Move To Reviewed");
moveChild.PopulateOnDemand = false;
moveChild.SelectAction = TreeNodeSelectAction.Select;
e.Node.ChildNodes[e.Node.ChildNodes.Count - 1].ChildNodes.Add(moveChild);
child = new TreeNode("");
Application["activeTree"] = new ArrayList();
((ArrayList)Application["activeTree"]).Add(e.Node.ChildNodes[e.Node.ChildNodes.Count - 1]);
}
}
}
// If there arent new yellow cards
else if (Application["activeTree"] != null)
{
// Populate the active tree
for (int i = 0; i < ((ArrayList)Application["activeTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["activeTree"])[i]);
}
}
// If there were new yellow cards and nodes that moved from reviewed tree to active tree
if (Application["idList"] != null && Application["activeTree"] != null && e.Node.ChildNodes.Count != ((ArrayList)Application["activeTree"]).Count)
{
for (int i = e.Node.ChildNodes.Count; i < ((ArrayList)Application["activeTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["activeTree"])[i]);
}
}
// Nullify the yellow card id's
Application["idList"] = null;
}
protected void ycReviewedTree_SelectedNodeChanged(object sender, EventArgs e)
{
ycActiveTree.PopulateNodesFromClient = false;
ycReviewedTree.SelectedNode.Text = "Move To Reviewed";
ycActiveTree.Nodes[ycActiveTree.Nodes.Count - 1].ChildNodes.Add(ycReviewedTree.SelectedNode.Parent);
int count = ((ArrayList)Application["reviewedTree"]).Count;
// Move all the nodes from reviewedTree application to activeTree application
for (int i = 0; Application["reviewedTree"] != null && i < count; i++)
{
((ArrayList)Application["activeTree"]).Add(((ArrayList)Application["reviewedTree"])[i]);
((ArrayList)Application["reviewedTree"]).RemoveAt(0);
}
}
protected void ycReviewedTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
if (Application["reviewedTree"] != null)
{
// Populate the reviewed tree
for (int i = 0; i < ((ArrayList)Application["reviewedTree"]).Count; i++)
{
e.Node.ChildNodes.Add((TreeNode)((ArrayList)Application["reviewedTree"])[i]);
}
}
}
}

View 1 Replies

Forms Data Controls :: Pager On Repeater Not Working / When Click Next Link Records Stay Same It Wont Changing For The Next 10 Records?

Feb 27, 2011

im tryin to create repeater from code behaind using C#. The data bind is working good, im tryin to put some pager. the pager is half working. i can see the pager links at the bottom, i can see the the code split the records to 10 lines each page as i set it but when i click the next link the records stay the same it wont changing for the next 10 records. my code

[Code]....

View 1 Replies

Forms Data Controls :: Inserting Records With DetailsView?

Mar 25, 2010

I have a DetailsView control that accepts two different fields to be populated. I need one of them to be masked so that whilst something can be entered, no-one can see what is actually being keyed?

View 6 Replies

Forms Data Controls :: Listview Not Inserting Records?

Feb 5, 2010

I have a listview that I automatically generated from a database table, enabling editing and inserting on the listview and the EntityDataSource that runs it.

I started customizing the listview templates so that I didn't have to see some of the fields (they're unnecessary from the standpoint of the form), and have alternately tried removing or hiding the unwanted fields. This pretty much patently results in me not being able to insert new records, although updating seems to work just fine. There are no error messages.

I then tried using InsertParameters in the datasource, but that didn't really help either.

In the codebehind I have an onInserting handler that should fill in some of the hidden/removed fields before the record goes to the database.

I've tried pretty much everything I can think of, and even my colleagues are kind of stumped. Why can't I insert records into this table/listview?

<asp:EntityDataSource ID="gradesEds" runat="server"
ConnectionString="name=SAAEntities" DefaultContainerName="SAAEntities"
EntitySetName="tblStudentGrades" AutoGenerateWhereClause="True" OrderBy="it.Date DESC"
EnableUpdate="True" EnableInsert="True">
<WhereParameters>
<asp:SessionParameter Name="StudentID" SessionField="SelectedStudentID" Type="String" />
<asp:SessionParameter Name="Class" SessionField="SelectedClass" Type="String" />
</WhereParameters>
<InsertParameters>
<asp:Parameter Name="GradeID" Type="Int32" Direction="Output" />
<asp:Parameter Name="StudentID" Type="String" />
<asp:Parameter Name="Prof" Type="String" />
<asp:Parameter Name="Class" Type="String" />
<asp:Parameter Name="Date" Type="DateTime" />
<asp:Parameter Name="Term" Type="String" />
<asp:Parameter Name="Year" Type="String" />
<asp:Parameter Name="Source" Type="String" />
<asp:Parameter Name="Grade" Type="String" />
<asp:Parameter Name="Read" Type="Boolean" />
<asp:Parameter Name="OtherInfo1" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo2" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo3" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo4" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo5" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo6" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo7" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo8" Type="Boolean" DefaultValue="false" />
<asp:Parameter Name="OtherInfo9" Type="Boolean" />
</InsertParameters>
</asp:EntityDataSource>
<asp:ListView ID="ListView1" runat="server" DataKeyNames="GradeID,StudentID"
DataSourceID="gradesEds" InsertItemPosition="LastItem" >
<ItemTemplate>
<tr style="background-color: #FFFBD6;color: #333333;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="GradeIDLabel" runat="server" Text='<%# Eval("GradeID") %>' />
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>' />
<asp:Label ID="ProfLabel" runat="server" Text='<%# Eval("Prof") %>' />
<asp:Label ID="ClassLabel" runat="server" Text='<%# Eval("Class") %>' />
<asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' />
<asp:Label ID="TermLabel" runat="server" Text='<%# Eval("Term") %>' />
<asp:Label ID="YearLabel" runat="server" Text='<%# Eval("Year") %>' />
</td>
<td>
<asp:Label ID="SourceLabel" runat="server" Text='<%# Eval("Source") %>' />
</td>
<td>
<asp:Label ID="GradeLabel" runat="server" Text='<%# Eval("Grade") %>' />
</td>
<td>
<asp:Label ID="CommentsLabel" runat="server" Text='<%# Eval("Comments") %>' />
</td>
<td>
<asp:Label ID="NotesLabel" runat="server" Text='<%# Eval("Notes") %>' />
</td>
<td>
<asp:CheckBox ID="ReadCheckBox" runat="server" Checked='<%# Eval("Read") %>'
Enabled="false" />
</td>
<td>
<asp:CheckBox ID="OtherInfo1CheckBox" runat="server"
Checked='<%# Eval("OtherInfo1") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo2CheckBox" runat="server"
Checked='<%# Eval("OtherInfo2") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo3CheckBox" runat="server"
Checked='<%# Eval("OtherInfo3") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo4CheckBox" runat="server"
Checked='<%# Eval("OtherInfo4") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo5CheckBox" runat="server"
Checked='<%# Eval("OtherInfo5") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo6CheckBox" runat="server"
Checked='<%# Eval("OtherInfo6") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo7CheckBox" runat="server"
Checked='<%# Eval("OtherInfo7") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo8CheckBox" runat="server"
Checked='<%# Eval("OtherInfo8") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo9CheckBox" runat="server"
Checked='<%# Eval("OtherInfo9") %>' Enabled="false" />
</td>
</tr>
</ItemTemplate>
<AlternatingItemTemplate>
<tr style="background-color: #FAFAD2;color: #284775;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="GradeIDLabel" runat="server" Text='<%# Eval("GradeID") %>' />
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>' />
<asp:Label ID="ProfLabel" runat="server" Text='<%# Eval("Prof") %>' />
<asp:Label ID="ClassLabel" runat="server" Text='<%# Eval("Class") %>' />
<asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' />
<asp:Label ID="TermLabel" runat="server" Text='<%# Eval("Term") %>' />
<asp:Label ID="YearLabel" runat="server" Text='<%# Eval("Year") %>' />
</td>
<td>
<asp:Label ID="SourceLabel" runat="server" Text='<%# Eval("Source") %>' />
</td>
<td>
<asp:Label ID="GradeLabel" runat="server" Text='<%# Eval("Grade") %>' />
</td>
<td>
<asp:Label ID="CommentsLabel" runat="server" Text='<%# Eval("Comments") %>' />
</td>
<td>
<asp:Label ID="NotesLabel" runat="server" Text='<%# Eval("Notes") %>' />
</td>
<td>
<asp:CheckBox ID="ReadCheckBox" runat="server" Checked='<%# Eval("Read") %>'
Enabled="false" />
</td>
<td>
<asp:CheckBox ID="OtherInfo1CheckBox" runat="server"
Checked='<%# Eval("OtherInfo1") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo2CheckBox" runat="server"
Checked='<%# Eval("OtherInfo2") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo3CheckBox" runat="server"
Checked='<%# Eval("OtherInfo3") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo4CheckBox" runat="server"
Checked='<%# Eval("OtherInfo4") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo5CheckBox" runat="server"
Checked='<%# Eval("OtherInfo5") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo6CheckBox" runat="server"
Checked='<%# Eval("OtherInfo6") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo7CheckBox" runat="server"
Checked='<%# Eval("OtherInfo7") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo8CheckBox" runat="server"
Checked='<%# Eval("OtherInfo8") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo9CheckBox" runat="server"
Checked='<%# Eval("OtherInfo9") %>' Enabled="false" />
</td>
</tr>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<table runat="server"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
<tr>
<td>
No data was returned.</td>
</tr>
</table>
</EmptyDataTemplate>
<InsertItemTemplate>
<tr style="">
<td>
<asp:Button ID="InsertButton" runat="server" CommandName="Insert"
Text="Insert" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Clear" />
</td>
<td>
<!--
<asp:TextBox ID="StudentIDTextBox" runat="server"
Text='<%# Bind("StudentID") %>' />
<asp:TextBox ID="ProfTextBox" runat="server" Text='<%# Bind("Prof") %>' />
<asp:TextBox ID="ClassTextBox" runat="server" Text='<%# Bind("Class") %>' />
--> <asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<!-- <asp:TextBox ID="TermTextBox" runat="server" Text='<%# Bind("Term") %>' />
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year") %>' />
--> </td>
<td>
<asp:TextBox ID="SourceTextBox" runat="server" Text='<%# Bind("Source") %>' />
</td>
<td>
<asp:TextBox ID="GradeTextBox" runat="server" Text='<%# Bind("Grade") %>' />
</td>
<td>
<asp:TextBox ID="CommentsTextBox" runat="server"
Text='<%# Bind("Comments") %>' />
</td>
<td>
<asp:TextBox ID="NotesTextBox" runat="server" Text='<%# Bind("Notes") %>' />
</td>
<td>
<asp:CheckBox ID="ReadCheckBox" runat="server" Checked='<%# Bind("Read") %>' />
</td>
<td>
<!-- <asp:CheckBox ID="OtherInfo1CheckBox" runat="server"
Checked='<%# Bind("OtherInfo1") %>' />
<asp:CheckBox ID="OtherInfo2CheckBox" runat="server"
Checked='<%# Bind("OtherInfo2") %>' />
<asp:CheckBox ID="OtherInfo3CheckBox" runat="server"
Checked='<%# Bind("OtherInfo3") %>' />
<asp:CheckBox ID="OtherInfo4CheckBox" runat="server"
Checked='<%# Bind("OtherInfo4") %>' />
<asp:CheckBox ID="OtherInfo5CheckBox" runat="server"
Checked='<%# Bind("OtherInfo5") %>' />
<asp:CheckBox ID="OtherInfo6CheckBox" runat="server"
Checked='<%# Bind("OtherInfo6") %>' />
<asp:CheckBox ID="OtherInfo7CheckBox" runat="server"
Checked='<%# Bind("OtherInfo7") %>' />
<asp:CheckBox ID="OtherInfo8CheckBox" runat="server"
Checked='<%# Bind("OtherInfo8") %>' /> -->
<asp:CheckBox ID="OtherInfo9CheckBox" runat="server"
Checked='<%# Bind("OtherInfo9") %>' />
</td>
</tr>
</InsertItemTemplate>
<LayoutTemplate>
<table runat="server">
<tr runat="server">
<td runat="server">
<table ID="itemPlaceholderContainer" runat="server" border="1"
style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
<tr runat="server" style="background-color: #FFFBD6;color: #333333;">
<th runat="server">
</th>
<th runat="server">
Date</th>
<th runat="server">
Source</th>
<th runat="server">
Grade</th>
<th runat="server">
Comments</th>
<th runat="server">
Notes</th>
<th runat="server">
Read</th>
<th runat="server">
OtherInfo9</th>
</tr>
<tr ID="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr runat="server">
<td runat="server"
style="text-align: center;background-color: #FFCC66;font-family: Verdana, Arial, Helvetica, sans-serif;color: #333333;">
<asp:DataPager ID="DataPager1" runat="server">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
<EditItemTemplate>
<tr style="background-color: #FFCC66;color: #000080;">
<td>
<asp:Button ID="UpdateButton" runat="server" CommandName="Update"
Text="Update" />
<asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
Text="Cancel" />
</td>
<td>
<asp:Label ID="GradeIDLabel1" runat="server" Text='<%# Eval("GradeID") %>' />
<asp:TextBox ID="StudentIDTextBox" runat="server"
Text='<%# Bind("StudentID") %>' />
<asp:TextBox ID="ProfTextBox" runat="server" Text='<%# Bind("Prof") %>' />
<asp:TextBox ID="ClassTextBox" runat="server" Text='<%# Bind("Class") %>' />
<asp:TextBox ID="DateTextBox" runat="server" Text='<%# Bind("Date") %>' />
<asp:TextBox ID="TermTextBox" runat="server" Text='<%# Bind("Term") %>' />
<asp:TextBox ID="YearTextBox" runat="server" Text='<%# Bind("Year") %>' />
</td>
<td>
<asp:TextBox ID="SourceTextBox" runat="server" Text='<%# Bind("Source") %>' />
</td>
<td>
<asp:TextBox ID="GradeTextBox" runat="server" Text='<%# Bind("Grade") %>' />
</td>
<td>
<asp:TextBox ID="CommentsTextBox" runat="server"
Text='<%# Bind("Comments") %>' />
</td>
<td>
<asp:TextBox ID="NotesTextBox" runat="server" Text='<%# Bind("Notes") %>' />
</td>
<td>
<asp:CheckBox ID="ReadCheckBox" runat="server" Checked='<%# Bind("Read") %>' />
</td>
<td>
<asp:CheckBox ID="OtherInfo1CheckBox" runat="server"
Checked='<%# Bind("OtherInfo1") %>' />
<asp:CheckBox ID="OtherInfo2CheckBox" runat="server"
Checked='<%# Bind("OtherInfo2") %>' />
<asp:CheckBox ID="OtherInfo3CheckBox" runat="server"
Checked='<%# Bind("OtherInfo3") %>' />
<asp:CheckBox ID="OtherInfo4CheckBox" runat="server"
Checked='<%# Bind("OtherInfo4") %>' />
<asp:CheckBox ID="OtherInfo5CheckBox" runat="server"
Checked='<%# Bind("OtherInfo5") %>' />
<asp:CheckBox ID="OtherInfo6CheckBox" runat="server"
Checked='<%# Bind("OtherInfo6") %>' />
<asp:CheckBox ID="OtherInfo7CheckBox" runat="server"
Checked='<%# Bind("OtherInfo7") %>' />
<asp:CheckBox ID="OtherInfo8CheckBox" runat="server"
Checked='<%# Bind("OtherInfo8") %>' />
<asp:CheckBox ID="OtherInfo9CheckBox" runat="server"
Checked='<%# Bind("OtherInfo9") %>' />
</td>
</tr>
</EditItemTemplate>
<SelectedItemTemplate>
<tr style="background-color: #FFCC66;font-weight: bold;color: #000080;">
<td>
<asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
</td>
<td>
<asp:Label ID="GradeIDLabel" runat="server" Text='<%# Eval("GradeID") %>' />
<asp:Label ID="StudentIDLabel" runat="server" Text='<%# Eval("StudentID") %>' />
<asp:Label ID="ProfLabel" runat="server" Text='<%# Eval("Prof") %>' />
<asp:Label ID="ClassLabel" runat="server" Text='<%# Eval("Class") %>' />
<asp:Label ID="DateLabel" runat="server" Text='<%# Eval("Date") %>' />
<asp:Label ID="TermLabel" runat="server" Text='<%# Eval("Term") %>' />
<asp:Label ID="YearLabel" runat="server" Text='<%# Eval("Year") %>' />
</td>
<td>
<asp:Label ID="SourceLabel" runat="server" Text='<%# Eval("Source") %>' />
</td>
<td>
<asp:Label ID="GradeLabel" runat="server" Text='<%# Eval("Grade") %>' />
</td>
<td>
<asp:Label ID="CommentsLabel" runat="server" Text='<%# Eval("Comments") %>' />
</td>
<td>
<asp:Label ID="NotesLabel" runat="server" Text='<%# Eval("Notes") %>' />
</td>
<td>
<asp:CheckBox ID="ReadCheckBox" runat="server" Checked='<%# Eval("Read") %>'
Enabled="false" />
</td>
<td>
<asp:CheckBox ID="OtherInfo1CheckBox" runat="server"
Checked='<%# Eval("OtherInfo1") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo2CheckBox" runat="server"
Checked='<%# Eval("OtherInfo2") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo3CheckBox" runat="server"
Checked='<%# Eval("OtherInfo3") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo4CheckBox" runat="server"
Checked='<%# Eval("OtherInfo4") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo5CheckBox" runat="server"
Checked='<%# Eval("OtherInfo5") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo6CheckBox" runat="server"
Checked='<%# Eval("OtherInfo6") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo7CheckBox" runat="server"
Checked='<%# Eval("OtherInfo7") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo8CheckBox" runat="server"
Checked='<%# Eval("OtherInfo8") %>' Enabled="false" />
<asp:CheckBox ID="OtherInfo9CheckBox" runat="server"
Checked='<%# Eval("OtherInfo9") %>' Enabled="false" />
</td>
</tr>
</SelectedItemTemplate>
</asp:ListView>

View 1 Replies

Forms Data Controls :: ListView Not Inserting Records

Sep 20, 2010

Here's the next instalment of my asp.net data access nightmare!

I've got a listview on my page, and when I run the page it correctly displays the data that it should. However, when I add data into the empty new record and hit the 'Insert' button the page posts back but the record isn't inserted. Annoyingly, I don't get any error!

The listview's datasource has an INSERT command and insert parameters specified. The button seems to be triggering the listview's insert method because the ItemInserting event fires.

With no error message to go on I'm struggling to figure out what the problem is. I have a feeling it's something to do with the makeup of the page. The listview in question is nested within an Accordion control and the listview's data source isn't set until runtime, when it's done in the ItemDataBound event of the Accordion control. As I say, though, it does RETRIEVE data correctly, it's just the inserting that's a problem.

I created a new, blank page with just this listview on it using the same code but not nesting it within any other control and hardcoding the datasource instead of setting it at runtime and that works perfectly, so I'm confident that my INSERT command, insert parameters and so forth are correct.

I've tried to get my listview to break, deliberately leaving out insert parameters and so forth just so it'll give me an error message but it never does! It's as if the insert isn't taking place at all, except that because the ItemInserting even takes place I'm assuming that it is.

View 14 Replies

Forms Data Controls :: FormView Is Inserting Two Records Instead Of Just One?

Sep 12, 2010

This FormView is inserting two records instead of just one.

[Code]....

[Code]....

View 1 Replies

Web Forms :: Unable To Refersh Dropdownlist After Inserting The Records?

Feb 23, 2010

I m unable to refersh my dropdownlist after inserting the records.

i m using this for textboxes...

finally
{
txtStdWeight.Text = string.Empty;
txtStdHeight.Text = string.Empty;
txtDisabilityPercentage.Text = string.Empty;
txtDisabilityDetail.Text = string.Empty;
txtFoodAllergy.Text = string.Empty;
txtMedicineAllergy.Text = string.Empty;
}

so how i set dropdownlist to "select" as default after inserting a record.

View 4 Replies

Web Forms :: Insert On Button Event Is Inserting 2 Records At A Time?

Oct 4, 2010

I have a form that is doing a simple insert, then a sub insert of a certain drop down selection is made. What i dont get is why the main insert is inserting duplicates and the sub works fine inserting 1 record per text as expected. I click the button 1 time, and when i check the table, there are 2 new records.. As you can see the insert is not wrapped with any conditions, once that is inserted i check if a slection was made and runs the sub insert.

My full code can be found in this post [URL], but here is what i have for my button event.

[Code]....

View 16 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved