|
Hi there,
Follow this
On rowDataBound event of gridview
1. Findcontrol of Button
2. FIndcontrol of checkBox
3. Add attribute and call javascript and pass the ID of checkbox
i.e btn.Attribute.Add("click","return check('"+chk.ClientID+"');");
4. In javascript function, Get Argument of Checkbox ID
if checkbox is checked return true else give alert and return false.
Best of luck
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
what is the way to enable or display the scroll bar of the gridview.
or is there anty property there for gridview. or any function.
|
|
|
|
|
biswa47 wrote: what is the way to enable or display the scroll bar of the gridview.
or is there anty property there for gridview. or any function.
It can be done with CSS.
Add this CSS to your GridView.
style="OVERFLOW: auto; WIDTH: 200px; HEIGHT: 120px"
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
How to populate a Drop down list taking data from database using javascript using ajax
|
|
|
|
|
|
i have table named emp
where empid and emp name are the colomns of the table.
now in the vs.2005.
i have taken a dropdown list and label.
in the drop down list i want to show the empid in dropdownlist and based up on the empid the corresponding empname shuld be populate in the label.
can you tell me how to write the code for it in vb.net
|
|
|
|
|
As I replied here,[^]
C#
<br />
SqlConnection dbConn = new SqlConnection(connectionString);<br />
<br />
dbConn.Open();<br />
<br />
SqlDataAdapter da = new SqlDataAdapter("SELECT empId,empName FROM emp", dbConn);<br />
DataSet ds = new DataSet();<br />
da.Fill(ds);<br />
<br />
dbConn.Close();<br />
<br />
DropDownList1.DataSource = ds.Tables[0];<br />
DropDownList1.DataTextField = "empName ";<br />
DropDownList1.DataValueField = "empId";<br />
DropDownList1.DataBind();
VB.NET
Dim dbConn As New SqlConnection(connectionString)<br />
<br />
dbConn.Open()<br />
<br />
Dim da As New SqlDataAdapter("SELECT empId,empName FROM emp", dbConn)<br />
Dim ds As New DataSet()<br />
da.Fill(ds)<br />
<br />
dbConn.Close()<br />
<br />
DropDownList1.DataSource = ds.Tables(0)<br />
DropDownList1.DataTextField = "empName "<br />
DropDownList1.DataValueField = "empId"<br />
DropDownList1.DataBind()
Hope it helps.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
I have created one webservice which contains some webmethds . It will compile successfully.
Once I modify the Default.asmx.cs file , for example add a new WebMethods,Update the WebMethods , the WSDL doesn't generate the new one. It will show the old one.
Pls give the solution ASAP.
Advance Thanks
jayaraj.r
|
|
|
|
|
jayarajmrj wrote: Once I modify the Default.asmx.cs file , for example add a new WebMethods,Update the WebMethods , the WSDL doesn't generate the new one.
You need to re-compile the WebService again. Then, Update the WebService or Generate the proxy by using wsdl webserviceURL -language:C# in command prompt.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
hi friends
what is themes and skins asp2.0
what is the differnce between to this
saravan
|
|
|
|
|
MSDN: ASP.NET Themes and Skins Overview
Themes and Control Skins
Themes are made up of a set of elements: skins, cascading style sheets (CSS), images, and other resources. At a minimum, a theme will contain skins. Themes are defined in special directories in your Web site or on your Web server.
Skins
A skin file has the file name extension .skin and contains property settings for individual controls such as Button, Label, TextBox, or Calendar controls.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi i convert some c# code to vb.net format,
But i am getting error in one place...,
Plz see this code:
This is C# code:
String addData = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" +
Guid.NewGuid() + "','" + new Guid(e.CommandArgument.ToString()) + "','" + txtAddShipName.Text.Trim() + "','" + txtAddShipCity.Text.Trim() + "')";
After convert to Vb.net format:
Dim addData As String = ("INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" _
+ (Guid.NewGuid) + "','" _
+ (New Guid(e.CommandArgument.ToString)) + "','" _
+ (txtAddShipName.Text.Trim) + "','" _
+ (txtAddShipCity.Text.Trim) + "')")
Whats the probs in thsi code?,
I have mentioned wher i get probs that is in bold letters...,
Regards,
Magi
|
|
|
|
|
try this:
Dim addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES " & _
"('" & (Guid.NewGuid) & "'," & _
" '"& (New Guid(e.CommandArgument.ToString)) & "'," & _
" '" & (txtAddShipName.Text.Trim) & "', " & _
" '" & (txtAddShipCity.Text.Trim) & "')"
|
|
|
|
|
No its giving same place error...,
Regards,
Magi
|
|
|
|
|
hey,
try it,
Private addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" + Guid.NewGuid
regards,
koolprasad2003
If the message is useful for U then please Rate This message...
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
The Converter gives me this ~
Dim addData As String = "INSERT INTO Ords (OrderId, CustomerId, ShipName, ShipCity) VALUES ('" & Guid.NewGuid() & "','" & New Guid(e.CommandArgument.ToString()) & "','" * txtAddShipName.Text.Trim() & "','" & txtAddShipCity.Text.Trim() & "')"
What error you are getting? at runtime or design time? Show us the error message.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
|
is there any way on how to kill a server process? because it happened 2 times, it displays an error with "too many connections".
anybody knows how to tackle this? Really nee help here.
Thanks in advance!
|
|
|
|
|
it may be happening bcz u r not closing the connection after doing the operation
killing the server process may not be a good idea in any case
|
|
|
|
|
i have installed ASPAJAXExtSetup and i my form in update panel am placing two dropdownboxes. first one contain countries and second one contain states.when i select a country, in second combobox i need to fill all the states in the selected country.
i am writing the function to take state from database in codebehind file.how can i call that function from javascript function when i click select country from first dropdown box .how can i do this? can anyone help me?................
|
|
|
|
|
Demo
Source code
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Dear Experts,
I have a shopping card. I want to support to my customer to change a template, change font and color.
Could you tell me some solutions to solve that problem.
If you have any references or source codes, please show me!
Thank you in advance
vtkiet05
|
|
|
|
|
Hi,
I am storing the checkboxlist items as comma seperated values in a row. My problem is during updation of those values. When i bind the values to the checkboxlist i want to display all items but only those items have to be checked which are present in the row.
For inserting i am using the followng code,
Dim sqlstr As String
Dim str As String = ""
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
For Each item As ListItem In CheckBoxList1.Items
If item.Selected = True Then
If str = "" Then
str = item.Text
Else
str = str & "," & item.Text
End If
End If
Next
sqlstr = "insert into test(c1) values(@c)"
Dim comm As New SqlCommand(sqlstr, dbconn)
comm.Parameters.Add("@c", SqlDbType.Char, 10).Value = str
Try
comm.ExecuteNonQuery()
Label1.Visible = True
Label1.Text = "Success"
Catch ex As Exception
Label1.Visible = True
Label1.Text = ex.ToString
End Try
|
|
|
|
|
n_gchaitra wrote: My problem is during updation of those values.
I'm not sure what problem you are facing... Can you tell us more about the problem you are facing and what you wanna do?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Michael, I have around 20 items in which only checked items have to stored. It is working fine. When i want to update that obviously i have to see all those twenty items. Here i want to them to compare with the items present in the table and the matching rows have to get checked.
Chaitra N
|
|
|
|