|
hi,
for that u have to set property of that linkbutton set commandName="CampaignName" and for second one commandName="ProductName" and gridview's rowcommand event get which command is fire...
Thanks,
Sun Rays
|
|
|
|
|
ok thanks. the message has been posted many times. sorry for this inconvenience bcoz of some connection problems...
|
|
|
|
|
Hi Sun Rays the code you sent is working fine but it is not meet my requirement. My requirement is in Grideview-SelectedIndexChanged event I have to find out.. pls see the code
protected void GVDoctorActivity_SelectedIndexChanged(object sender, EventArgs e)
{
string strCampaign;
LinkButton LbtCampaign;
int rowIndex = GVDoctorActivity.SelectedIndex;
LbtCampaign = (LinkButton)(GVDoctorActivity.SelectedRow.Cells[4].FindControl("lbtnCampaign"));
strCampaign = LbtCampaign.Text;
lbProducts.DataSource = adapterCampaignDrug.GetProductsByCampaignId(1);
lbProducts.DataTextField = "SKU";
lbProducts.DataBind();
Panel3.Visible = true;
MultiView1.ActiveViewIndex = 0;
}
in this event am getting the perticular column data item. if i put this code in rowcommandevent it is giving error... so in this eventonly i want to know which itemhas been clicked.. can you tell me how I can approach?
|
|
|
|
|
u can do this i have vb.net code
If e.CommandName = "comm1" Or e.CommandName = "comm2" Then
Dim row As GridViewRow
row = CType(CType(e.CommandSource, WebControl).Parent.Parent, GridViewRow)
If row IsNot Nothing Then
Dim lbtn As LinkButton
lbtn = CType(row.FindControl("lbtn"), LinkButton)
irkahc wrote: LbtCampaign = (LinkButton)(GVDoctorActivity.SelectedRow.Cells[4].FindControl("lbtnCampaign"));
for this u can write this,,
LbtCampaign = CType(row.Cells[4].FindControl("lbtnCampaign"), LinkButton)
End If
end if
Thanks,
Sun Rays
|
|
|
|
|
HI Sun Rays pls send me the code in c#. while converting this line of code
row = CType(CType(e.CommandSource, WebControl).Parent.Parent, GridViewRow)
from vb.net to c# am getting problems..
Thanks
|
|
|
|
|
ok I got solution for that one...the equavalant code is
row = (GridViewRow)((WebControl)e.CommandSource).Parent.Parent;
thanks Rays.
|
|
|
|
|
I was just wondering, does anyone know of a way to programmatically control page loading in .NET?
The reason is this. I'm using an open-source text editor control in a private project of mine for content management, where users can edit whole pages and save them to the database, to be approved and displayed later on the front of the site. The control is brilliant, really powerful, but it takes a while to load, and it looks really disjointed when it's doing so, as the page appears like a swiss cheese coming at you out of the mist... I've had a stab at it myself and asked the good men at Google, but no joy so far. Ideally I would set a point, like after the page header, and not display anything to the user until the entire page has loaded, so that it looks more, well, slick. Anybody have any ideas?
All the dude ever wanted... was his rug back.
|
|
|
|
|
Off the top of me head:
It would be easy to cover the page with a shim that has a nice Web 2.0 animated AJAX loading image (buzzword dump all the way!). This could be done with CSS so the rest of the page would be set to display:none while the shim would fill the whole page (or whatever portion it is you need hidden). You could then set the shim to display:none and display the hidden content once the control is loaded and ready.
The problem is knowing when this happens. document.onload wouldn't work as I assume thats where the control starts loading. The simplest option would be to set a timeout of how long it roughly takes for the control to load, then show the content, but this has loads of drawbacks as you never really know what the time will be.
So after all that it boils down to: does the control have an event that you can hook into that gets raised when the controls loads? If so, use that to hide the shim and show the content.
|
|
|
|
|
In a Gridview there are two templated linkbutton columns. I want to know that on which link(dataitem) the user has clicked.. data is bounded from database... Can any one help me?
pls see the code..
<asp:gridview id="GVDoctorActivity" runat="server" autogeneratecolumns="False" datakeynames="DoctorActivityId"
="" datasourceid="DoctorActivityDataSource" skinid="GridView" font-size="10pt" width="920px" enableviewstate="False" onselectedindexchanged="GVDoctorActivity_SelectedIndexChanged">
<columns>
<asp:boundfield datafield="DoctorId" headertext="DoctorId" sortexpression="DoctorId"
="" visible="True">
<asp:templatefield headertext="Campaign Name">
<itemtemplate>
<asp:linkbutton commandname="Select" id="lbtnCampaign" runat="server" causesvalidation="false"
="" text="<%# Eval("CampaignName") %>">
<asp:templatefield headertext="ProductName">
<itemtemplate>
<asp:linkbutton commandname="Select" id="lbtnCampaign" runat="server" causesvalidation="false"
="" text="<%# Eval("ProductName") %>">
The user may click on any one either on CampaignName or ProductName dataitem... I want to know on which item the user has clicked...? I am using asp.net 2.0 and C#
|
|
|
|
|
Hi
You can do this job by CammanName Property of the link button control and RowCammand Event of the GridView Control
|
|
|
|
|
body {<br />
background-image:url(Images/red.jpg);<br />
background-repeat:repeat-y;<br />
}
folders:
root
root/images
root/subfolder
this is my css coding
however whenever i navigated in the asp website to another folder (subfolder)
the css cant find the image file any way to solve this?
|
|
|
|
|
u have to add that same image folder in sub folder.. it will solve problem.
Thanks,
Sun Rays
|
|
|
|
|
Where is this CSS declared? By the sounds of things its in the page. the url() directive is relative to the document the CSS is in, in this case the page so the subfolder won't work. Move the CSS into an external file and reference it on each page, the url() should then point to the image relative to the CSS file.
So if you had folder:
root
root/css
root/images
root/subfolder
With your .css file in the root/css folder you'd want this:
body {<br />
background-image:url(../images/red.jpg);<br />
}
|
|
|
|
|
Hi,
I have a form which contains a gridview which I populate in the Page_Load method from a basic datasource (an ArrayList of objects). I want to be able to add items to the gridview from a button and I also need to be able to delete and ideally edit the new entries.
I've read about the GridView and it seems there are no simple ways of adding my items. Is there a way of reading the information from the GridView back into an arraylist, adding the new item to the arraylist and re-binding the gridview to the modified data source?
How about the deleting and editing items?
|
|
|
|
|
i want the event for Label like Button_click event.
How can i make it?
pl let me know.
thanks in advance.
|
|
|
|
|
Have you looked at either the LinkButton or HyperLink controls?
|
|
|
|
|
yeah,
i have seen LinkButton & Hyperlink, they are undrelined, i want the control which is not underlined.
once visit: www.microsoft.com
in this,some controls r there without underline
|
|
|
|
|
Have you thought about changing the style of the object so that it isn't underlined? That's how the other controls work.
|
|
|
|
|
ya that's wat i want, how to change the style of the object so that it isn't underlined?
thanks,
|
|
|
|
|
u can use CSS for that linkbutton.. so the line will be go...
text-decoration:none;
Thanks,
Sun Rays
|
|
|
|
|
Create lable web control i create with lable1 in page and place Label1.Attributes.Add("onclick","javascript:alert('this is done')");
in Page_Load event
-- modified at 6:48 Friday 30th March, 2007
|
|
|
|
|
You can write an event for Label_click by just double clicking the Label in the Visual Studio 2005 or whatever IDE you use. This creates an event handler for the specified Label click.
You don't have to be AFRAID!
|
|
|
|
|
Hi All,
I have a program where users login using username and password found in users table in sql. My aim is to make users login with their active directory account.
Any suggestions, sites i would be thankfull.
|
|
|
|
|
samerh wrote: Any suggestions
What sort of suggestions are you looking for? What bit are you stuck on?
|
|
|
|
|
All i know is that you need to do forms authentication to be able to talk to active directory, or am i wrong?
Unfortunaltely, i have never used this concept before and i am clueless about it. If you can redirect me to some usefull sites that covers the topic.
Thanks in advance.
|
|
|
|