|
please write event name in gridview property.
<asp:gridview id="view1" pageindexchanging="view1_PageIndexChanging" xmlns:asp="#unknown">
|
|
|
|
|
Again the same error. What to do?
<asp:gridview id="view1" xmlns:asp="#unknown">pageindexchanging="view1_PageIndexChanging"
AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
OnRowCommand="GridView1_RowCommand" runat="server" CellPadding="4" xmlns:asp="#unknown"
ForeColor="#333333" GridLines="None" PageSize="5">
The GridView 'view1' fired event PageIndexChanging which wasn't handled.
|
|
|
|
|
bind urs grid on page index changing also...call grid bind functin here also..
|
|
|
|
|
write the code of your data binding in paging event again.
|
|
|
|
|
Hi
I have a textbox on page that should be numeric and non zero
What can we set the ValidationExpression to validation control
|
|
|
|
|
You can use this javascript function
Place a HTML text box (here its name is Text1)and onBlur event write a function
function abc()
{
var res=document.getElementById("Text1").value;
if(isNaN(res)|| document.getElementById("Text1").value==0)
{
document.form1.Text1.value="";
}
}
modified on Wednesday, March 4, 2009 5:28 AM
|
|
|
|
|
Put the validation expression as
validationexpression=\d{0,10}
its only accepting only integer values in the range 0 to 10
or Change it to
ValidationExpression="[0-9]*"
<asp:regularexpressionvalidator id="RegularExpressionValidator1" runat="server" controltovalidate="TextBox1" errormessage="Please Enter only Numeric" validationexpression="[0-9]*" xmlns:asp="#unknown">
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
BANGALORE
"Winners don't do different things. They do things differently. ...
modified on Wednesday, March 4, 2009 5:25 AM
|
|
|
|
|
I want accecpt all integer and non zero
|
|
|
|
|
You could use a comparevalidator to check the value is greater than 0
|
|
|
|
|
You can use regex to find if the entered data is a "Natural Number". Google will help you find it.
Also, make sure that the regex should NOT have a check that text begins with 0. Reason being user can enter 0000003434 which is a valid entry as per your criteria.
Time is the best teacher; unfortunately it kills all of its students.
जय हिंद
|
|
|
|
|
Hi.
For a GridView, how to retrieve the cell values of a selected row?
Thank you!
|
|
|
|
|
You asked this question before and I gave you the answer.
The reason why it could not have worked for you is most likely your setting a row's state as Selected wrong.
My question therefore: how do you select the row, in other words, what code do you exectue in the application, so that it recognizes your desired row as .SelectedRow.
Looking at it very hard or highlighting is not the right way.
Usually, where you actually do Select a row, getting data from it is really, really easy.
string something = Gridview1.SelectedRow.Cells[0].Text;
Honestly, do post some more information, maybe some code of your own if you want people's replies to be relevant.
var question = (_2b || !(_2b));
|
|
|
|
|
Thank you Greg Chelstowski;
I tried your code and there:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridViewRow row = GridView1.Rows[GridView1.SelectedIndex];
string strValCell = row.Cells[2].Text;
}
public void GridView1_SelectedIndexChanged(Object sender, EventArgs e)
{
TextBox1.Text = GridView1.SelectedRow.Cells[2].Text;
}
but it doesn't work
" any result"
and if i do
public void GridView2_SelectedIndexChanged(Object sender, EventArgs e)
{
TextBox tb = GridView1.SelectedRow.FindControl("id0") as TextBox;
if (tb != null)
TextBox1.Text = tb.Text;
else
TextBox1.Text = "no data";
}
I have always "no data"
<columns>
<asp:templatefield xmlns:asp="#unknown">
<edititemtemplate>
<asp:textbox id="id0" runat="server" text="<%# Bind("c1") %>"></asp:textbox>
</edititemtemplate>
<itemtemplate>
<asp:label id="id01" runat="server" text="<%# Bind("c1") %>"></asp:label>
</itemtemplate></asp:templatefield></columns>
|
|
|
|
|
public void grdbind()
{
try
{
con.Open();
SqlDataAdapter adp = new SqlDataAdapter("select UM_VC50_UserId,UM_IN4_Address_No_FK,UM_VC50_Role from T060011", ConfigurationManager.ConnectionStrings["cn2"].ConnectionString);
DataTable dt = new DataTable();
adp.Fill(dt);
grd_detail.DataSource = dt;
grd_detail.DataBind();
// int gridID = 0, dtID = 0;
Int32 i;
for (i = 0; i < grd_detail.Rows.Count; i++)
{
// //dtID = Convert.ToInt32(dt.Rows[i]["UM_IN4_Address_No_FK"]);
// for (int GridRowCount = 0; i < grd_detail.Rows.Count; GridRowCount++)
// {
// gridID = Convert.ToInt32(((Label)(grd_detail.Rows[GridRowCount].Cells[1].FindControl("lbl_sr"))).Text);
// if (dtID == gridID)
string role = dt.Rows[i][2].ToString();
if (role == "A")
{
CheckBox chk = new CheckBox();
chk = ((CheckBox)grd_detail.Rows[i].Cells[0].FindControl("chk1"));
chk.Checked = true;
}
}
}
catch (Exception ex)
{
}
}
|
|
|
|
|
make the gridview paging property true and write fire the event of grid view paging.
or follow the code.
eg.
{
protected void grdemp_PageIndexChanging(object sender, GridViewPageEventArgs e)
//grdemp is ame of grid view
{
grdemp.PageIndex = e.NewPageIndex;
}
}
Regards
Keyur Satyadev
|
|
|
|
|
i did that the problem is not that .. i have solved it but thnx for response.
|
|
|
|
|
I am looking for code where i can integrate the outlook with asp.net
I want to create an appoint from asp.net in outlook
here is the code for that
Imports System.Reflection
Imports Outlook = Microsoft.Office.Interop.Outlook
Module Module1
Sub Main()
' Create an Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application()
' Create a new AppointmentItem.
Dim oAppt As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
' Set some common properties.
oAppt.Subject = "Created using OOM in VB .NET"
oAppt.Body = "Hello World"
oAppt.Location = "Room 1201"
oAppt.Start = Convert.ToDateTime("05/31/2004 9:00:00 AM")
oAppt.End = Convert.ToDateTime("05/31/2004 1:00:00 PM")
oAppt.ReminderSet = True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy
oAppt.IsOnlineMeeting = False
' Save to Calendar.
oAppt.Save()
' Clean up.
oApp = Nothing
oAppt = Nothing
End Sub
End Module
but i am not able to delete that appoint from asp.net
|
|
|
|
|
You're an idiot. I explained this to you already. This is VB code, it will create an appointment on the SERVER. You cannot create or delete appointments on the client machine. Buy a book on ASP.NET and read it, you obviously have no idea how it works.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
in productdetails page first i check if user is authorised then product display in productdetails page otherwise go to this url
Response.Redirect("login.aspx?ReturnURL=productdetails.aspx?pid="+p+ "&cat=" + c + "&lev=" + l+"", false);
first time it show right url
"http://localhost:1479/fp/login.aspx?ReturnURL=productdetails.aspx?pid=6&cat=8&lev=2"
but after login page its only show
"http://localhost:1479/fp/productdetails.aspx?pid=6"
d'nt know where cat & lev goes .
Tell me where m wrong.
|
|
|
|
|
You need to Url encode that ReturnUrl querystring otherwise the ampersands get treated as other variables for login.aspx
|
|
|
|
|
Hi Guys I am not good in JavaScript…
I have 3 textboxes….
I want to calculate 2Textbox values and want to show the calculate value to TextBox3 OnTextChange Event of TextBox2 …
Like..
TextBox1 = 10
TextBox2 = 20 (OnTextChange Event) (10+20)
TextBox3 = 30
Please provide me a Function and Where do I need to call this function?
Thanks..
|
|
|
|
|
call this function
function DoSum()
{
document.getElementbyid('<%= txtbox3.ClientID %>').value = Number(document.getElementbyid('<%= txtbox1.ClientID %>').value) + Number(document.getElementbyid('<%= txtbox2.ClientID %>').value);
}
umerumerumer
|
|
|
|
|
I am not able to call OnTextChange Event ...
|
|
|
|
|
why dont you use onblur event of textbox.
textbox1.attributes.add("onblur","doSum()");
Government Dyal Singh College Lahore.
|
|
|
|
|
Public Class Form1
Dim flag As Integer = 1
Dim tem, j As Integer
Private Sub timer(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim path As String = "C:\C#\LED\off.gif"
Dim path1 As String = "C:\C#\LED\on.gif"
Me.PictureBox1.Image = Image.FromFile(path)
If j <= Val(Me.TextBox2.Text) Then
If flag = 1 Then
Me.PictureBox1.Image = Image.FromFile(path)
flag = 0
ElseIf (flag = 0) Then
Me.PictureBox1.Image = Image.FromFile(path1)
flag = 1
End If
j = j + 1
If j = Me.TextBox2.Text Then
Timer1.Interval = Me.TextBox3.Text * 1000
j = 0
End If
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
tem = Math.Floor(Val(Me.TextBox1.Text / Me.TextBox2.Text))
Timer1.Enabled = True
Timer1.Interval = tem * 1000
End Sub
End Class
modified on Monday, March 9, 2009 3:33 PM
|
|
|
|