|
I think you have an extra closing bracket.
|
|
|
|
|
What mistake? It's VB
|
|
|
|
|
you must first set the variable:
Dim oBut As ImageButton = CType(datagrid1.Items(datagrid1.SelectedIndex).FindControl("image"), ImageButton)
then execute the attributes.add method:
oBut.Attributes.Add("onMouseOver", "window.open('webform1.aspx');")
daniero
|
|
|
|
|
Hi ,
i have posted this question before & i reposted it , now i need the answer please ,i really need it i swear cuz i'm building an asp.net application & i have to finish it .
well,i will explain to make it more clear :
i want that when i type a letter or a number or whatever in ma textbox , this letter appear in a label , i mean once i type the letter , i want that letter appear in ma label
i hope uyou understand i think it is clear
i initialized the autopostback propriety of ma textbox into true but it works just when the focus leave the text box not for each letter
try to be good if you can't be the best
|
|
|
|
|
You need to do this in javascript probably. Use the onKeyUp event.
|
|
|
|
|
thnx man , but can you give me a clear example because i heard before that i have to use javascript but the problem is that nobody told me how ?
thank you again
try to be good if you can't be the best
|
|
|
|
|
Mohammed Amine wrote: nobody told me how
WHy don't you try figuring it out on your own rather than expecting people to give you the answers. There are many resources available to learn Javascript.
|
|
|
|
|
Mohammed Amine wrote: i have posted this question before & i reposted it , now i need the answer please
This isn't a help desk and your not asking your professor, although he is probably monitoring.
|
|
|
|
|
From the posts it seems that you need the javascript solution.
Let the textbox id be txt1
The asp:label that you are using transforms into a <span>
let its id be lbl1
then write something like
document.getElementById("lbl1").innerHTML = document.getElementById("txt1").value;
I think this will do your job.
Thanks,
Pradipta Basu
|
|
|
|
|
ok, thank you i want to try it but can you tell me where should i write this line ? & can you try to explain a little bit please like that i will be sure of ma self
thank you very much
try to be good if you can't be the best
|
|
|
|
|
You can look at the code below. Hope this will solve your problem.
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <br />
<br />
<html><br />
<head><br />
<title>Test</title><br />
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><br />
<meta name="CODE_LANGUAGE" Content="C#"><br />
<meta name=vs_defaultClientScript content="JavaScript"><br />
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5"><br />
<script type="text/javascript"><br />
<!--<br />
function setValue()<br />
{<br />
document.getElementById("lblName").innerHTML = document.getElementById("txtName").value;<br />
}<br />
</script><br />
</head><br />
<body><br />
<br />
<form id="Form1" method="post" runat="server"><br />
<asp:TextBox ID="txtName" Runat="server" onkeyup="Javascript:setValue();"></asp:TextBox><br /><br />
<asp:Label ID="lblName" Runat="server" /><br />
<br />
</form><br />
<br />
</body><br />
</html><br />
Save this in a aspx file and then run. Note that it is not using any code-behind.
Thanks
Pradipta Basu
|
|
|
|
|
Hi , thank you very much man i appreciate your help , but i will annoy you a little bit , please can you explain that line to me ?
what is the role of innerHTML ?
the necessary is understanding that line ok ?? pleaaaaase & thank you very very much
try to be good if you can't be the best
|
|
|
|
|
|
For IE you can also use innerText. But it won't work in Mozilla. So using innerHTML is better.
Thanks,
Pradipta Basu
|
|
|
|
|
hello
i am using vs2005 and microsoft sql server 2005. In vs->server explorel it does not show me any databases. What is the default path of the data for sql server 2005?
|
|
|
|
|
In Server Explorer try to add new Connection
Stonepit
|
|
|
|
|
I have a custom control with two properties and one overrided method render .. whenever i assign DataTable to one property i preserves it but when the render function is called its value is null
here is my code
<br />
using System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
namespace Nav<br />
{<br />
[ToolboxData("<{0}:ucMenu runat=server></{0}:ucMenu>")]<br />
public class ucMenu : WebControl<br />
{<br />
DataTable _dtMenu; <br />
string _id;<br />
public ucMenu()<br />
{<br />
<br />
}<br />
public DataTable XMLDataSource<br />
{<br />
get<br />
{<br />
return (_dtMenu);<br />
}<br />
set<br />
{<br />
_dtMenu = value.Copy();<br />
}<br />
<br />
}<br />
public string NavID<br />
{<br />
get<br />
{<br />
return (_id);<br />
}<br />
set<br />
{<br />
_id = value;<br />
}<br />
<br />
}<br />
protected override void Render(HtmlTextWriter writer)<br />
{<br />
writer.Write("<ul id=" + _id + ">");<br />
if (_dtMenu != null)<br />
{<br />
for (int i = 0; i < _dtMenu.Rows.Count; i++)<br />
{<br />
writer.Write("<li><a href=" + _dtMenu.Rows[i]["href"].ToString() + " >" + _dtMenu.Rows[i]["text"].ToString() + "</a></li>");<br />
}<br />
<br />
}<br />
writer.Write("</ul>");<br />
writer.Flush();<br />
base.Render(writer);<br />
<br />
}<br />
}<br />
}
IN HTML i m embedding it as
< MyBar:ucMenu ID="UcMenu1" runat="server" />
and in code behind
protected ucMenu MyBar = new ucMenu();
on top of class
can you please tell me why my datatable refernce to null in render even i have ref it to datatable from property
R A M
|
|
|
|
|
How do you set the XMLDataSource property? in code-behind or in the web page? Are you sure that the value is not null by the time you set the property of the control?
|
|
|
|
|
I m setting through code behind and value is not null when i set it to XMLDataSource property. It assigns the value correctly because i have checked through debugging. I think there is some problem with declaring the control .. isnt it?
R A M
|
|
|
|
|
Rizvi Malik wrote: MyBar:ucMenu ID="UcMenu1" runat="server" />
and in code behind
protected ucMenu MyBar = new ucMenu();
Ah yes, now I look at your sample code again and see the cause: You declare the control in the web page with the id UcMenu1 , meanwhile you declare a new instance MyBar in code-behind, and I guess that you set the property of the second instance other than the first one. In this case, you can declare the control in code-behind like this: (in the version 2.0, you no need to this):
protected ucMenu UcMenu1;
|
|
|
|
|
Thanx alot minhpc_bk .. so nice of you ..
R A M
|
|
|
|
|
Good day. How do i get the data from the database and display in textbox or label. i'm using the asp.net (VB script) to develop the page. Do anyone can help me to solve the problem? Thanks.
Best Regards,
Pei Sun
|
|
|
|
|
I would suggest going to MSDN and working through some of the asp.net tutorials. Asp.net also does not use VB script directly - maybe you mean VB.net.
|
|
|
|
|
Thanks.
Best Regards,
Pei Sun
|
|
|
|
|
Good Day. I have a problem in select the record in the datagrid using radio button. My problem is i have a datagrid with radio button. How can i select one record at a time when click on the radio button? Anyone can give me an example or sample guidelines? Thanks.
Best Regards,
Pei Sun
|
|
|
|