|
sir actualy, i have created a no of buttons in one page using array of buttons. so wht can i do for it???? thank u sir for that
i hv use this code for click event but it does not work
public void btrequest1[i]_Click(object sender, EventArgs e)
{
Response.Write("You have click on this");
}
yogesh
modified on Monday, December 17, 2007 9:31:09 AM
|
|
|
|
|
Hi yogesh,
Use this one
public partial class _Default : System.Web.UI.Page
{
Button[] b = new Button[10];
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < 10; i++)
{
b[i] = new Button();
b[i].Text = "Dynamic Button " + i.ToString() ;
Panel1.Controls.Add(b[i]);
b[i].Click += new System.EventHandler(mybtn_Click);
}
}
public void mybtn_Click(object sender, EventArgs e)
{
Button mybtn =sender as Button;
Response.Write(mybtn.Text.ToString());
}
}
This will solve your problem !!!
|
|
|
|
|
Hi All,
I am working on a web application. I want to handle right click close button's event of IE title bar in my application. I want to fire some code before user’s window closes. I have not found any event (nor using javascript) related to title bar. Can anyone help me?
|
|
|
|
|
garimajain_mca wrote: I have not found any event (nor using javascript)
There isn't one. And there wouldn't be for a known period. Period.
Reason: That would mean a malicious website would intrude into your system and wreak havoc on your security.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
You can't trap a specific close event. You can identify that it is closing via javascript, but not what the cause was.
|
|
|
|
|
in one of the cs file i have enum like
public enum EnumError : int
{
noerror = 0,
ignorerror,
smallerror,
criticalerror
}
i want to access this enum on aspx.cs file
like this
int x=(int) EnumError.criticalerror ;
but i am not getting EnumError .????
how to do this.
|
|
|
|
|
Is this in the same namespace? There's nothing wrong with your syntax as far as I can see, so I would suspect that it's a namespace issue.
|
|
|
|
|
Hello,
I have a server side dropdown and text box in ASP.NET. There is a strage problem I have noticed.
dropdown: When I try to click this control by Mouse in firefox it doesn;t show me options. IN IE it works fine
Text box: When I try to click this control by Mouse in firefox or in IE I can not feed values. But If I reach the control by pressing TAB i can enter some values
Any kind of help is apreciated
The View source code is as below:
<select name="ctl00$IMFContentPlaceHolder$DateFromToDropdownlist" id="ctl00_IMFContentPlaceHolder_DateFromToDropdownlist" onchange=" dateControlConditions(this.value)" style="color:Black;font-family:Arial;font-size:10px;height:18px;width:110px;">
<option value="Last 24 Months">Last 24 Months</option>
<option value="Last 12 Months">Last 12 Months</option>
<option value="AFTER">After</option>
<option value="BEFORE">Before</option>
<option value="BETWEEN">Between</option>
<option value="NOT BETWEEN">Not Between</option>
<option value="ALL">All</option>
</select>
// There is a visibility style which I make visible from Javascript
<input name="ctl00$IMFContentPlaceHolder$FromDateTextbox" type="text" id="ctl00_IMFContentPlaceHolder_FromDateTextbox" style="font-family:Arial;font-size:12px;height:18px;width:65px;visibility: hidden" />
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
Hello Friends,
I've taken a DataList and in this datalist i've displayed images from my database.
But now i want to display a big image onmouseover accordingly the image.
For example: as i onmouseover my first image then a new big image of first image should be displayed and if i onmouseover my second image then it should display a big one of second image
something like this
http://www.asp.net/ajax/showcase/default.aspx[^]
|
|
|
|
|
Have you had a look at the code on that page? It's just javascript showing/hiding divs i think.
|
|
|
|
|
I've looked at the code on tht page.
So can u let me know how it is done.........
Further, i've solved my prob. to an extent but still there is prob.
And the prob. is i've to send the url of the image on which the mouse is hovring and the url is saved in my database so i'm using the following code for sending the url but it's throwing a parser error
The Server tag is not well formed
and the code i'm using to send the url is given below plz have a look and suggest me the right way.......
<asp:Image ID="myImage" onmouseover="doTooltip(event,0,'<%# DataBinder.Eval(Container.DataItem,"Image") %>')" onmouseout="hideTip()" ImageUrl='<%# DataBinder.Eval(Container.DataItem,"Image") %>' Runat="server" Height="125" Width="125" >
</asp:Image>
|
|
|
|
|
hi any body know how can i generate inline code automatically when creating
dynamic control on webpage........
|
|
|
|
|
Can you expand a little on what you mean? What are you trying to do?
|
|
|
|
|
hi friend
thanks for replying...
in my web page i create multiple controls dynamically with proper alignment... but these control did not generate the inline code..
is it possible to get a inline code dynamically for dynamic control
|
|
|
|
|
What exactly do you mean by inline code? Javascript?
|
|
|
|
|
No... HTML Source.
simply in .Net IDE 2005 when u design ur page, the HTML source(source view) automatically created...
i need that logic when creating dynamic controls....
|
|
|
|
|
HI
I Wrote My Code as follows. Its Working fine. But delete event didnt fire.
I also mentioned the Delete event in GridView Control
<asp:gridview autogeneratecolumns="False">
runat="server" id="gvwRoleScreen" width="100%">
OnRowDeleting="gvwRoleScreen_RowDeleting"
OnRowEditing="gvwRoleScreen_RowEditing"/>
<asp:templatefield>
<itemtemplate>
<asp:imagebutton runat="server" imagealign="AbsMiddle" commandname="Delete">
ImageUrl="~/Images/drop.png" OnClientClick="return confirm('Are you sure to delete this record?');" />
r_palanivel83 10:01 4 Jan '06
modified on Monday, December 17, 2007 5:40:00 AM
|
|
|
|
|
r_palanivel83 wrote: But delete event didnt fire
Not firing means, Client event or Server event?
|
|
|
|
|
how to create class file?????????????????
Thiwa
|
|
|
|
|
right click on the name of your project in solution explorer, then click on 'add new item', then select 'Class' and press Add button.
|
|
|
|
|
how to write a class file.pls send me a sample class file.
|
|
|
|
|
Dear All,
I got a problem with the following case: I would like to enable a button after the file export (using asp.net), the code is:
Dim fi As System.IO.FileInfo = New System.IO.FileInfo(strPath)
Response.Clear()
Response.AddHeader("Content-Disposition", "attachment;filename=" + fi.Name)
Response.AddHeader("Content-Length", fi.Length.ToString())
Response.ContentType = "Text Documents (*.txt)"
Response.WriteFile(fi.FullName)
Response.Flush()
btnXXX.enable=true
But the button cannot be enabled, i have no idea why it happened.
I got no idea about what happened...
Thank for your kind help!
|
|
|
|
|
What you set the button enable value on on page load ?
After post back he don't what you set the button enable value. so you need to check on page load.
because HTTP is a state less.
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
Thanks for your reply!
In page load, i have set the button .Enabled = True
but whatever i type, e.g. msgbox ("Hello")
also no response...
|
|
|
|
|
I'm not sure you can have anything after the Response.Flush(). I think you might have further problems as it is going to treat this page like a .txt file, not an aspx page.
|
|
|
|