|
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
|
|
|
|
|
JAS GIRI wrote: How to remove Browser comparability
What do you mean ? Can you reframe your question ?
|
|
|
|
|
I am looking for code wherein I can create and delete an appointment from asp.net code
|
|
|
|
|
I assume you want to create and delete appointments for the user of your website, not on the server ? Impossible. ASP.NET generates HTML and javascript, neither of which can do that. If you target IE only, you may be able to do it with VBScript, IF the user gives your site permission to run ( they will be warned not to ). Overall, I'd suggest you read an ASP.NET book and don't bid on jobs before you know if you can do them or not.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks for ur reply
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
Can u please help
|
|
|
|
|
This looks like VB code to me. Refer to my first answer. You can't create appointments on your clients machine, only on the server. Buy a book.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi
i want to redirect to user to login page if he/she
is not login in the system.
after successful login he/she can visit the site or view the pages?
regards
keyur satyadev
|
|
|
|
|
Create a session variable when one logs in to the system and then check for the session variable to every page. You can use base class of the page to get it done or you can place the checking inside the master page. Just if the session variable is not present, Response.Redirect to the login page.
Thats all..
|
|
|
|
|
Hi
i stored Password as key using one way hashing function SHAI now how i verify the enterd Password with stored password . i did coding like below but it is not working. any idea.
protected void ValidatePassword(object source, System.Web.UI.WebControls.ServerValidateEventArgs args)
{
string sqlCmd =
"SELECT Password FROM User_Profile WHERE Password = " +
Util.Quote(Password.Value.Trim());
OdbcCommand command = new OdbcCommand(sqlCmd, con);
OdbcDataReader reader = command.ExecuteReader();
if (reader.Read())
{
string storedHashedPassword = (string)reader["Password"];
string givenHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile
(Password.Value.ToString(),"SHA1");
if(storedHashedPassword == givenHashedPassword)
{
args.IsValid = true;
reader.Close();
}
}
}
in on button click
if (!(IsValid))
{
return;
}
Response.Write("Entered Password is correct ");
Guide me where iam doing wrong
Best Regards
|
|
|
|
|
Define 'not working'. If the stored password is hashed, you obviously need to ash it in order for your SQL to work. What you've got, can't work, if the stored password is hashed.
Rameez Raja wrote: "SELECT Password FROM User_Profile WHERE Password = " +
Util.Quote(Password.Value.Trim());
Rameez Raja wrote: string storedHashedPassword = (string)reader["Password"];
string givenHashedPassword = FormsAuthentication.HashPasswordForStoringInConfigFile
(Password.Value.ToString(),"SHA1");
Yep - that's it. You're saying that you want the unhashed password returned if it exists, then you compare it to the hashed one.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
|
Hi
i am working with visual source safe and not able to delete the file from source safe.
its showing the error "vss Datavase\data\o\okebaaaa.a not found"
i m login with admin login although error should be thier?
any one have idea abt this visual source safe?
|
|
|
|