|
var gridViewCtlId = '<%=gridview1.ClientID%>';
var gridViewCtl = null;
var curSelRow = null;
var curRowIdx = -1;
function getGridViewControl()
{
if (null == gridViewCtl)
{
gridViewCtl = document.getElementById(gridViewCtlId);
}
}
function onGridViewRowSelected(rowIdx)
{
var selRow = getSelectedRow(rowIdx);
if (null != selRow)
{
curSelRow = selRow;
var cellValue = getCellValue(rowIdx, 0);
alert(cellValue);
}
}
function getSelectedRow(rowIdx)
{
return getGridRow(rowIdx);
}
function getGridRow(rowIdx)
{
getGridViewControl();
if (null != gridViewCtl)
{
return gridViewCtl.rows[rowIdx];
}
return null;
}
function getGridColumn(rowIdx, colIdx)
{
var gridRow = getGridRow(rowIdx);
if (null != gridRow)
{
return gridRow.cells[colIdx];
}
return null;
}
function getCellValue(rowIdx, colIdx)
{
var gridCell = getGridColumn(rowIdx, colIdx);
if (null != gridCell)
{
alert(gridViewCtlId)
return gridCell.innerText;
}
return null;
}
If i call it as:
For Each row As GridViewRow In GridView1.Rows
CType(row.FindControl("Textbox1"), TextBox).Attributes("onclick") = "javascript: return getCellValue("+row.rowindex.toString()+",1)"
It shows the heading of 2nd column only if i click on first row.
2nd row onwards it does not show any value.
<div class="ForumSig">sanjay kumar samantaray</div>
|
|
|
|
|
i want to make a tool tip window for my asp controll so that the tooltip message should appear in a window like thin insted of a simple text
thanx
|
|
|
|
|
Ajax toolkit has a callout control which may help you out.
|
|
|
|
|
|
Hello Friends
I want to get Minutes from string like "1:20"
Can any one know how to do this?
Thanks
Pathan
---------------------------------------------------
|
|
|
|
|
Imran Khan Pathan wrote: I want to get Minutes from string like "1:20"
<br />
string t = "1:20";<br />
string strTime() = t.split(":");<br />
<br />
Console.Write(strTime(0));
Console.Write(strTime(1));
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.
|
|
|
|
|
Thanks
But you made mistak to write code
string[] h = tt.Split(':');
also I cant get h(0) or h(1) in c#
But Thanks I have solved problem
pathan
---------------------------------------------------
|
|
|
|
|
Yeah. I typed just like that so C# code are mixed with VB code.. I hope you got some ideas from my code at least ( I have to code in both C# and VB.NET for different projects everyday so i got confused sometime.. )
The correct one is as follwoing ~
string t = "1:20";<br />
string[] strTime = t.Split(':');<br />
<br />
Console.Write(strTime[0]);
Console.Write(strTime[1]);
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.
|
|
|
|
|
Dear All,
I want to create a template field say texbox inside a gridview to accept marks in different 5 subjects.
Marks fields should not be blank.
i want to have java script to check each textbox at client side only.
sanjay kumar samantaray
|
|
|
|
|
You can also use RequiredFieldValidator control.
Best Regard
pathan
---------------------------------------------------
|
|
|
|
|
Put required field validator control within that template control and set control to validate property.
You can event set validation group property (framework 2.0 or greater) for causing validation on certain events only.
|
|
|
|
|
i m sending mail to yahoo.com through asp.net web page but mails are not send to yahoo.co.in, what is the reason.
|
|
|
|
|
hum? you are sending mail to yahoo.com. but you are expecting this mail to go to yahoo.co.in ??
if you are sending a mail to aa, this mail will go to aa (not bb.) that means your code works fine.
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.
|
|
|
|
|
It may be because of wrong SMTP Server........
Here i'm sending the code. It may help..........
using System.Web.Mail;
MailMessage mail1=new MailMessage();
mail1.To="Receiver ID";
mail1.From="Your ID"; //But Remember It must be your domain ID
mail1.Subject="Enter Your Subject";
mail1.Priority=MailPriority.High;
mail1.Body="" ;
try
{
SmtpMail.SmtpServer="Your SMTP Server";// You Can also "127.0.01" as ur smtp server
SmtpMail.Send(mail1);
}
catch
{
lblMsg.Text="Error Occured!!";
lblMsg.ForeColor=Color.Red;
}
|
|
|
|
|
hi,
I am using bulletedlist control and have set displaymode as linkbuttons. And binding data to that. Till here it is working fine. Now when i select some link on that it has to move to some other page. but how to do this i am not able to retrieve the text from the bulleted list. I mean based on the value present in the bulletedlist i need to write the query. But finding difficult since it does not have either a text property or selecteditem property.
Chaitra N
|
|
|
|
|
protected void BulletedList1_Click(object sender, BulletedListEventArgs e)
{
int ind = e.Index;
string txt = BulletedList1.Items[ind].Text;
}
|
|
|
|
|
But since it does not possess navigateurl property, how can i give the link to that?
Chaitra N
|
|
|
|
|
Thank you. It is working. One more doubt. I am uploading files (.doc,.gif,.excel,etc) and storing in the server. Now I want to open those files when i click the link buttons. But I am able to get only the path but how to open it. what changes i need to the following code?
Dim SQLString As String = "SELECT filepath FROM pictures WHERE title = '" & BulletedList1.Items(e.Index).Text & "'"
Dim dr As Data.SqlClient.SqlDataReader
Dim comm As New Data.SqlClient.SqlCommand(SQLString, dbconn)
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
Dim str As String
dr = comm.ExecuteReader
While dr.Read
str = dr.Item(0)
End While
dr.Close()
TextBox1.Text = str
Chaitra N
|
|
|
|
|
hi....
sorry for late reply....
here u r selecting filepath in query....
so, .. your data reader will give you only path of that file...
if you want to open u need to download on client machine .. at that time it will give option for save or open file....
OR .................. OR ............... OR .............
Use System.IO and using this class create streamreader and read file ....
.....
Try ... this....
- Best of work...........
|
|
|
|
|
hello frnd,
i have developed a application and wants to give the help facility to user like a internet explorer help when pressing F1
how can i developed a CHM using .Net
if any one knows then please help
regards,
koolprasad2003
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
We used to use HTML Help workshop to generate CHM in our project.
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 a user-control (Menu-bar) on my page and on click of menu item on user-control, I have to raise an event and handle that event on my main aspx page. On the basis of that event I have work further. Please resolve my problem.
nikki
|
|
|
|
|
How about an XmlHttp Post to serverside and a Web Handler to recieve it?
|
|
|
|
|
i have a table in sqlserver2005 named emp.
where the coloumns of the emp table are as follows.
empid char(3),
empname varchar(20),
empaddrs varchar(20),
empDOB dateandtime,
emp_no varchar(10)
i want to genertae emp_no as autogenertaed sequencitial number.
where the format of the auto genertaed number for emp_no will be - "id-yyyy-nnnn"
where 1st 2 places are the no of his emp_id i.e 01 or 02 like that
2nd four palces are the year of DOB i.e 2001,or 20005 like this
next four places are the numbers i.e 0001 ,0002 like this(it should be sequential number).
example of auto generated number are-0120010001,0219990002, 0320000003.and so on..
how will i generate this type of sequential no in asp .net (backend vb.net.)
when ever i save a record for a particular employee after giving the data in the front end of their corresponding textboxes, the emp_no should be generated in the database and stored in the emp_no coloumn of emp table.
(i know only how to generate auto num.by setting its identity to true.but dont know what to write in the formula filed so that i can genrate the above type of auto generated number)
thanks in advance
|
|
|
|