|
Hi...
I am creating a checkbox list dynamically, and i am checking the selected items.When the page gets postback more than once i am unable to check the selected check box in the list.It always returns false, What could be the problem.
Thanks in Advance
Mahesh.J
|
|
|
|
|
If you create items dynamically, they are not restored in the viewstate tree if the item does not exist prior to page load ( creating it in page load is too late ). The best thing to do in this case is to have the form submit itself and examine the form itself for the details of what items were checked.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Javascript function is not executed under OnClick Event in Object tag ..in the click event iam writting some alert message.
|
|
|
|
|
POST YOUR CODE
please don't forget to vote on the post that helped you.
|
|
|
|
|
The problem is in your code. Not sure how you were hoping for more info than that
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am using Asp.Net 2005 and i would like to close my application when i click a button
Sathya
|
|
|
|
|
I'm not sure that your question makes sense. You can do window.close() in your browser if you want ( the user will be prompted ), but this will stop the current user from interacting with your site, it won't fire any event on the server side, or guarantee that no-one is connected to your site.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am asking close the browser then ur application will end. I want the same operation in browser close in button click.
Sathya
|
|
|
|
|
I am SO sick of people downvoting me b/c they are stupid.
Like I said, you can close the browser with javascript, the user will be prompted, but that doesn't end your app, your app won't even get a message to say that is what happened.
You need to read a book on web development.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
u know ASP.NET very well. we r beginners So only we r asked questions. If u answer otherwise ignore that don't scold others
Sathya
|
|
|
|
|
I am here b/c I want to help. But when people ask again and ignore the answer, that's just annoying. If you wanted to know something further, that's cool. But, you just asked the same thing again.
It's also annoying to be voted as giving a bad answer, when you gave the only possible correct answer. THAT is why I feel frustrated.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
SathyaSiva wrote: i would like to close my application when i click a button
Which application? and On which button click event?
If you are asking about browser close button then you do not need to do anything for this because browser closes itself when you click its close button.
whats your requirement and what do you want to do?
regards
kHan
please don't forget to vote on the post that helped you.
|
|
|
|
|
using vb
my problems in insertion
ERROR [42000] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00936: missing expression
my code is
<%@ import Namespace="System.Data.ODbc" %>
<%@ Import Namespace=" System.Data"%>
<script runat="server">
Sub submit(sender As Object, e As EventArgs)
dim dbconn
dbconn=New ODbcConnection("dsn=oracle;uid=starter;pwd=starter;")
dbconn.Open()
dim isql,idbread,idbcomm
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add( "@fname",fname.text)
idbcomm.Parameters.Add( "@id",id.Text)
idbcomm.Parameters.Add( "@lname",lname.Text)
idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()
dbconn.Close()
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<th>
Id Number:</th>
<asp:TextBox id="id" runat="server"></asp:TextBox>
<br />
<br />
<th>MaJor:</th>
<asp:TextBox id="major" runat="server"></asp:TextBox>
<br />
<br />
<th>First Name:</th>
<asp:TextBox id="fname" runat="server"></asp:TextBox>
<br />
<br />
<th>Last Name:</th>
<asp:TextBox id="lname" runat="server"></asp:TextBox>
<br />
<br />
<hr />
<asp:Button id="Button1" onclick="submit" runat="server" Text="Submit"></asp:Button>
</form>
</body>
</html>
sanjeev
modified on Saturday, June 28, 2008 2:04 AM
|
|
|
|
|
Which line gives you the error ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
line no not given
sanjeev
|
|
|
|
|
Well, I never put code in the aspx ( what a disaster ), but I'm sure you can set a breakpoint with F9 and step through the code to see which line causes the problem.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have modified my code with only insertion parts
sanjeev
|
|
|
|
|
You don't want me to try to help you then ?
I need to know what line causes the error to try to guess what the problem is.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
EXACTLY I HAVE NOT A LINE NUMBER BUT ERROR IN THIS PART
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)" idbcomm=new odbccommand(isql,dbconn) idbcomm.Parameters.Add( "@fname",fname.text) idbcomm.Parameters.Add( "@id",id.Text) idbcomm.Parameters.Add( "@lname",lname.Text) idbcomm.Parameters.Add( "@major",major.Text) idbcomm.ExecuteNonQuery()
sanjeev
|
|
|
|
|
problems from this part of code
isql="Insert Into students(id,first_name,last_name,major) values (@fname,@id,@lname,@major)"
idbcomm=new odbccommand(isql,dbconn)
idbcomm.Parameters.Add( "@fname",fname.text)
idbcomm.Parameters.Add( "@id",id.Text)
idbcomm.Parameters.Add( "@lname",lname.Text)
idbcomm.Parameters.Add( "@major",major.Text)
idbcomm.ExecuteNonQuery()
sanjeev
|
|
|
|
|
I am new to .Net
In web.conf i have given the connection
<connectionstrings>>
<add name="CS" connectionstring="Data Source=.\SQLExpress;Integrated Security=True;Database=master;Timeout=60;">
<connectionstrings>
Now i want to call the connection to my vb.class and from there i want to use it for my default.aspx page. i dont want to give connections for each of my control.if there is any other alternative kindly suggest me.
Thanks
|
|
|
|
|
|
I've setup a small menu using the WebControls.Menu. It works fine when I run it within VS but when I publish it to the web it does not work. When running the page on the web there is some text next to the root item of the menu which says 'Expand Main topic'. There is also a small white box with a red x inside it. How can I get this to work on the web?
|
|
|
|
|
here is my code
i m trying to insert all the selected files in database having two tables
in First table (Details) columns are ID,Name and Path no
and in second table (Path ) columns are ID
i hav inserted Dataset (Dataset1 ) which is having both tables
btt sumhoww records couldnt be inserted
private void button1_Click(object sender, EventArgs e)
{
openFileDialog1.Filter = "Image (*.BMP;)|*.BMP|" + "All files (*.*)|*.*";
openFileDialog1.Multiselect = true;
openFileDialog1.Title = "Select BMP Image Files";
openFileDialog1.ShowDialog();
// string flnm = openFileDialog1.FileName;
flnms = openFileDialog1.FileNames;
int file_number = flnms.Length;
int pathno = 0;
DataSet1 dataset1 = new DataSet1();
DataSet1TableAdapters.DetailsTableAdapter detailsTableAdapter = new DataSet1TableAdapters.DetailsTableAdapter();
DataSet1TableAdapters.PathTableAdapter pathTableAdapter = new DataSet1TableAdapters.PathTableAdapter();
// int row_max = dataset1.Tables["bmpFront"].Rows.Count;
//int row_max = 188;
detailsTableAdapter.Connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"I:\\Picture to DB\\Picture to DB\\All Files.mdb\"");
detailsTableAdapter.Connection.Open();
pathTableAdapter.Connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"I:\\Picture to DB\\Picture to DB\\All Files.mdb\"");
pathTableAdapter.Connection.Open();
pathTableAdapter.Fill(dataset1.Path);
detailsTableAdapter.Fill(dataset1.Details);
int row_max_path = dataset1.Path.Rows.Count;
int row_max_details = dataset1.Details.Rows.Count;
for(int i=0;i<file_number;i++)>
{
string str;
str = flnms[i].ToString();
string[] str1 = str.Split('\\');
string name = str1[str1.Length - 1];
string path = getpath(str1) ;
// DataSet1 dataset1 = new DataSet1();
if (i == 0)
{
pathno = 999;
for (int j = 0; j < dataset1.Tables["Path"].Rows.Count; j++)
{
string str_compare = getpath((dataset1.Path[j][1].ToString()).Split('\\'));
if (str_compare == path)
{
pathno = int.Parse(dataset1.Path[j]["Path Id"].ToString());
}
else
{
continue;
}
}
}
if(pathno == 999)
{
pathTableAdapter.InsertQuery(row_max_path+1, path);
pathno = dataset1.Path.Rows.Count;
}
detailsTableAdapter.InsertQuery(row_max_details+1, name, pathno.ToString());
row_max_path++;
row_max_details++;
}
pathTableAdapter.Connection.Close();
detailsTableAdapter.Connection.Close();
|
|
|
|
|
Are you getting any error ?
IF Yes then on which line.
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|