Click here to Skip to main content
15,915,975 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: FileUpload.HasFile always return false Pin
mr_muskurahat6-Jan-09 1:42
mr_muskurahat6-Jan-09 1:42 
AnswerRe: FileUpload.HasFile always return false Pin
div_gusain6-Jan-09 1:39
div_gusain6-Jan-09 1:39 
QuestionIndex was out of range. Must be non-negative and less than the size of the collection. Pin
reogeo20086-Jan-09 0:48
reogeo20086-Jan-09 0:48 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
Brij6-Jan-09 1:05
mentorBrij6-Jan-09 1:05 
GeneralRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
reogeo20086-Jan-09 1:08
reogeo20086-Jan-09 1:08 
GeneralRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
Brij6-Jan-09 2:19
mentorBrij6-Jan-09 2:19 
AnswerRe: Index was out of range. Must be non-negative and less than the size of the collection. Pin
Ashok Login3-Oct-09 4:03
Ashok Login3-Oct-09 4:03 
Questionerrot in program that Textbox-Textbox4 does not exsist in current context Pin
Jas 0076-Jan-09 0:10
Jas 0076-Jan-09 0:10 
I was making a simple guestbook where i define labels(Name,mail,location and message ). i made a table for this. when i run the program . error comes that Textbox1- Text4 does not exsists in current context. following is coding that i have done.
----------------------------------------------------------------------

guestbook.aspx:-
]]>





<title>Untitled Page



Guestbook.NET


Post New Entry













Name: <asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown">
E-mail: <asp:textbox id="TextBox2" runat="server" xmlns:asp="#unknown">
Location: <asp:textbox id="TextBox3" runat="server" xmlns:asp="#unknown">

Message:
<asp:textbox id="TextBox4" runat="server" xmlns:asp="#unknown">

 



                       
     
<asp:button id="Button1" runat="server" onclick="Button1_Click" text="Submit" xmlns:asp="#unknown">












------------------------------------------

default.cs :-
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["cn"].ConnectionString);
SqlCommand cmd = new SqlCommand();



protected void Page_Load(object sender, EventArgs e)
{


}
protected void Button1_Click(object sender, EventArgs e)
{
conn.Open();
cmd.Connection = conn;
cmd.CommandText = "insert into guest values(@Name ,@email ,@location,@Message)";
cmd.Parameters.Add("@Name", SqlDbType.VarChar).Value = TextBox1.Text;
cmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = TextBox2.Text;
cmd.Parameters.Add("@Location", SqlDbType.VarChar).Value = TextBox3.Text;
cmd.Parameters.Add("@Message", SqlDbType.Text).Value = TextBox4.Text;
conn.Close();

}
}

i waste my 2 hours in this program i dont know where is the problem. plz help
AnswerRe: errot in program that Textbox-Textbox4 does not exsist in current context Pin
sarang_k6-Jan-09 1:41
sarang_k6-Jan-09 1:41 
Questionrandom selection of business object classes Pin
highjo6-Jan-09 0:05
highjo6-Jan-09 0:05 
QuestionPassing VB arrays as Java Script parameters Pin
jonhbt5-Jan-09 23:17
jonhbt5-Jan-09 23:17 
AnswerRe: Passing VB arrays as Java Script parameters Pin
Aman Bhullar6-Jan-09 0:00
Aman Bhullar6-Jan-09 0:00 
AnswerRe: Passing VB arrays as Java Script parameters Pin
Abhijit Jana6-Jan-09 0:01
professionalAbhijit Jana6-Jan-09 0:01 
Questionhow to set the dynamically created image to the image box in asp.net Pin
Hema Bairavan5-Jan-09 22:55
Hema Bairavan5-Jan-09 22:55 
AnswerRe: how to set the dynamically created image to the image box in asp.net Pin
Aman Bhullar5-Jan-09 23:56
Aman Bhullar5-Jan-09 23:56 
AnswerRe: how to set the dynamically created image to the image box in asp.net Pin
Guffa6-Jan-09 3:17
Guffa6-Jan-09 3:17 
QuestionFavicon for IE6/IE7...... Pin
way2arun5-Jan-09 21:35
way2arun5-Jan-09 21:35 
AnswerRe: Favicon for IE6/IE7...... Pin
N a v a n e e t h5-Jan-09 21:45
N a v a n e e t h5-Jan-09 21:45 
GeneralRe: Favicon for IE6/IE7...... Pin
way2arun5-Jan-09 22:07
way2arun5-Jan-09 22:07 
AnswerRe: Favicon for IE6/IE7...... Pin
Abhijit Jana5-Jan-09 22:07
professionalAbhijit Jana5-Jan-09 22:07 
GeneralRe: Favicon for IE6/IE7...... Pin
way2arun5-Jan-09 22:13
way2arun5-Jan-09 22:13 
AnswerRe: Favicon for IE6/IE7...... Pin
jonhbt5-Jan-09 23:20
jonhbt5-Jan-09 23:20 
AnswerRe: Favicon for IE6/IE7...... Pin
Guffa6-Jan-09 3:47
Guffa6-Jan-09 3:47 
QuestionResize the Panel according to its contents Pin
PritiP5-Jan-09 21:23
PritiP5-Jan-09 21:23 
AnswerRe: Resize the Panel according to its contents Pin
Abhijit Jana5-Jan-09 21:44
professionalAbhijit Jana5-Jan-09 21:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.