|
|
I've had trouble like this before. I think it has to do with where you are putting the javascript. If your javascript is at the end of the html, than when the <body> tag is rendered it hasn't rendered the function yet so it doesn't know where it is. Try putting the javascript in a <script> block that is above the <body> tag. Since this is in the removed property I think that is all you should have to do. If it were in the onload property then you might have trouble getting it to work because when it runs the javascript and tries to find the length of the listbox you could get an error because it hasn't rendered the listbox yet.
The only other thing I noticed is that you don't have a ; after the fun1() But that isn't a big problem.
I hope this helps.
|
|
|
|
|
i need the name of the montt like march not 3
wat code i need to use in c#
Suresh.R
|
|
|
|
|
|
Never worked for it but one idea is if dateTIme object method does not return any string then
declare string array like
string[] str ={ "January", "February", "March", "April" };
now
you can get month by simply
str[DateTime.Now.Month-1];
-1 is important
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Today.Month)
Visual Studio can't evaluate this, can you?
public object moo<br />
{<br />
__get { return moo; }<br />
__set { moo = value; }<br />
}
|
|
|
|
|
Hi,
I don't have much experience with script languages, but since i have this problem for long time and i still didn't solve it, i think that script language can be solution. I am using JavaScript language.
My problem is next: I have data in mssql 2005 database, one field is picture, one field is description (some text) and one field is some text that contain some links. My goal is to present data to asp.net page in next manner: first from left is picture and right from picture goes description and right from description goes text with links. And next row goes bellow and that is goal.
Problem arise when i have a lot of data in database and i should present that data to asp.net page, because it is not normal to present 500 rows of data on one asp.net page.
So my question is: How do i break data from sql database to be presented on multiple asp.net pages ? For example at the bottom of page there are numbers that are links to pages that contain data from database that didn't fit one previous pages.
Please help, i have this problem for very long time,
best regards
Dragoslav Zaric
MCAD, M. Sc. of Astrophysics
|
|
|
|
|
You can use GridView Control to show those records.
and use allowpaging=true of Gridcontrol .
also you can use mode property in page to definie page settings numbers or first next last etc
Naveed Kamboh
Complexity kills, Write easy code for your self.
isolutionteam
|
|
|
|
|
hi guys below is the code i have in a button that i am trying to make it create a new record in the targeted table
so far it keep givin me this error
Incorrect syntax near 'Name'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Incorrect syntax near 'Name'.
string cs = WebConfigurationManager.ConnectionStrings["HASDBConnectionString1"].ConnectionString;<br />
string insertbidder = "INSERT Bidder " + "(NRIC, First Name, Last Name, "<br />
+ "Company, Address, ContactNumber, Comments)"<br />
+ "VALUES(@NRIC, @First_Name, @Last_Name, @Company, @Address, @ContactNumber, @Comment)";<br />
<br />
SqlConnection con = new SqlConnection(cs);<br />
SqlCommand cmd = new SqlCommand(insertbidder, con);<br />
<br />
<br />
cmd.Parameters.AddWithValue("NRIC",txtnric.Text);<br />
cmd.Parameters.AddWithValue("First_Name",txtFirstname.Text);<br />
cmd.Parameters.AddWithValue("Last_Name", txtlastname.Text);<br />
cmd.Parameters.AddWithValue("Company",txtcompany.Text);<br />
cmd.Parameters.AddWithValue("Address",txtaddress.Text);<br />
cmd.Parameters.AddWithValue("ContactNumber", txtcontactnumber.Text);<br />
cmd.Parameters.AddWithValue("Comment", txtcomment.Text);<br />
con.Open();<br />
cmd.ExecuteNonQuery();
|
|
|
|
|
Hi,
string insertbidder = "INSERT Bidder " + "(NRIC, First Name, Last Name, "
change this as
string insertbidder = "INSERT INTO Bidder " + "(NRIC, First Name, Last Name, "
Bye
Jith
|
|
|
|
|
change this as
string insertbidder = "INSERT INTO Bidder " + "(NRIC, [First Name], [Last Name], "
IF your column names have spaces in then you need to wrap them in Square Brackets in your queries
-- modified at 7:51 Friday 23rd March, 2007
|
|
|
|
|
Dear all,
i am making web application using asp.net2.0,C#,sql2000 using VS2005.
In a form i have two dropdownlistbox where first i am populating it through sqldatasource. and second dropdownlistbox, I populate programically based on value of first. Now i woulsd like select one option set as default to second dropdownlistbox too. i did try with the following code. but as i used clear in code. May be because of that. Select One option not appear. Please Help me in solving this problem.i first define dropdownlistbox as
<asp:dropdownlist id="DropDownListcode" runat="server" appenddatabounditems="True"
autopostback="True" datasourceid="SqlDataSource2" datatextfield="display"
datavaluefield="Groundmode" onselectedindexchanged="DropDownListcode_SelectedIndexChanged"
style="left: 187px; position: absolute; top: 150px" width="200px">
<asp:listitem text="Select One">
and On it selectedindex_changed. i fetch data from database and populate it as
setting = ConfigurationManager.ConnectionStrings["databaseconnection"];
if (setting != null)
{
conn = new SqlConnection(setting.ConnectionString);
cmd = new SqlCommand("Sp_Grab_maxno_grdtran");
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@mode", SqlDbType.VarChar);
cmd.Parameters["@mode"].Value = DropDownListcode.SelectedValue;
cmd.Connection = conn;
conn.Open();
rdr = cmd.ExecuteReader();
if (rdr.Read())
{
try
{
int count = int.Parse(rdr["groundmaxno"].ToString());
DropDownListmaxno.Items.Clear(); // used to clear previous record fetched by other option//DropDownListmaxno.Items[0].Text = "Select One";
for (int i = 0, j = 1; i < count; i++, j++)
{
//DropDownListmaxno. = j.ToString();
//DropDownListmaxno.Items[i].Value = j;
DropDownListmaxno.Items.Add(new ListItem(j.ToString()));
}
}
please help
thanks
regards
imran khan
|
|
|
|
|
Does it mean that you want to show the Select one as first in drop down list
Write this line
DropDowmList2.Items.Insert(0, new ListItem("Select One"));
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
i need help in converting results retrieved and stored as an XmlNode to be displayed on a datagrid. i'm new to asp.net so any help or suggestions would be greatly appreciated. thanks in advance!
Dim ws As New WRcinema.WebServices
Dim results As XmlNode
Try
results = ws.fnEnquireFilmRecords("1B014", "", "", "", 9, 2006, 0, 0)
' Dim onode As XmlNodeList = results.SelectNodes("/")
Dim n As Integer
Catch ex As Exception
Response.Write(ex.Message)
End Try
|
|
|
|
|
Please delete the unwanted posts
Thanks and Regards
Sandeep
If you want something you never had,
do something you have never done!
|
|
|
|
|
Hi
I have a checkbox in gridview in asp.net page and also contain a link that open popup in gridview. once user close the popup, the checkbox should be checked for that record. Wonder how do i achieve this?
Regards
Nancy
|
|
|
|
|
szewanng wrote: once user close the popup, the checkbox should be checked for that record
When showing popup pass the checkbox id to that page. And from the popup page use javascript's parent property to set the chekbox checked.
|
|
|
|
|
Thanks for your reply.
Could you please provide some sample code?
Thanks
Nancy
|
|
|
|
|
I have several reports created. I want to get them to stretch to the width of the ReportViewer control.
Currently they remain a static width and on some machines they show squeezed up.
Is there a way to get the reports to either dynamically change with the Browser (like the reportviewer control does, or to make the reports be the size of the viewer by default?
Thanks for any tips!
PhrankBooth
|
|
|
|
|
|
Tried Zoom but it doesn't do anything like I want.
I basically need the report to behave like a webpage; when you resize the browser window the page resizes along.
Anyone have ideas about this, is there a setting I'm missing?
Thanks!
PhrankBooth
|
|
|
|
|
This is the answer:
ReportViewer.AsyncRendering = false
ReportViewer.SizeToReportContent = true
PhrankBooth
|
|
|
|
|
Hi Guys,
This is a newbie type question for ya.
I have a datalist on a usercontrol, that is bound to an object datasource.
What I want to do is display a default message if the objsource does not return any records,
|
|
|
|
|
Not sure I understand, but I think what you're asking is how to find out the number of rows in a datalist? Look for List.Rows.Count, and then take action (such as hiding the list and showing a div) depending on the result...
Or have I misunderstood you?
"Now I guess I'll sit back and watch people misinterpret what I just said......"
Christian Graus At The Soapbox
|
|
|
|
|
hi
i wanted to build a print button in asp.net 2.0
i wrote the following code
"codebehind"
<br />
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
Button1.Attributes.Add("onClick","window.print()");<br />
Button1.Visible = false;<br />
<br />
}
now.. the button does disappear, but the print window doesnt come up.
please help.. and i dont want a html input button.
Kunal
|
|
|
|