|
I think you must use dropdown.ClientID to get that ..
Can you post the code you pass as script in RegisterStartupScript... so that I could clarify where you are wrong...
|
|
|
|
|
Thanks. But since I posted that message, I found the problem. It had to do with some hidden fields on the form. Thanks anyway.
|
|
|
|
|
Great to see you solved yourself.
|
|
|
|
|
Good Day
its Friday and am Tired. i request your assistance here
Am binding a grid with RRS info. now there is a Field that Displays the URL and a i made it to display a Hyperlink in that field like this
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkUserID" runat="server" NavigateUrl='<%# Eval("Link")%>' Text='<%#Eval("Link") %>'>
</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
Now it appears as a link, Good, but the Problem is that when i click the link it does not navigate to the URL.
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
modified on Friday, September 4, 2009 10:23 AM
|
|
|
|
|
Vuyiswa Maseko wrote: when i click the link it does not navigate to the URL
Which URL get opened after you click on link?
Show us how you are saving url in table.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Thank you
this did the Trick
<asp:TemplateField HeaderText ="Link">
<ItemTemplate>
<asp:HyperLink ID="linkurl" runat = "server" NavigateUrl ='<%# Eval("Link")%>' Target ="_blank" Text='<%# Eval("Link")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
In RowDataBound of Grid, Use FindControl to identify the GridColumn and use, control.attributes.add() , to add the link.
This will do the job !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Thank you these did the Trick
<asp:TemplateField HeaderText ="Link">
<ItemTemplate>
<asp:HyperLink ID="linkurl" runat = "server" NavigateUrl ='<%# Eval("Link")%>' Target ="_blank" Text='<%# Eval("Link")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Thanks For your reply
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
You are using server tag for Server Side LinkButton ... this is weird.
Always remember, the server side properties doesnt render to the client, so if you see your browser, the anchor tag will not hold the NavigateUrl Property..
So either you use <a > tag directly here and place href='<%# Eval("Link")%>' ... or use RowDataBound Event of the GridView.
Inside RowDataBound Event use:
LinkButton lnk = e.item.FindControl("lnkUserID") as LinkButton;
lnk.NavigateUrl = DataBinder.Eval(e.item.DataItem, "Link") as string;
Hope you got what you need. ...
Cheers.
|
|
|
|
|
Thank you these did the Trick
<asp:TemplateField HeaderText ="Link">
<ItemTemplate>
<asp:HyperLink ID="linkurl" runat = "server" NavigateUrl ='<%# Eval("Link")%>' Target ="_blank" Text='<%# Eval("Link")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Thanks For your reply
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
use Hyperlink instead
CC26
|
|
|
|
|
Thank you
this did the Trick
<asp:TemplateField HeaderText ="Link">
<ItemTemplate>
<asp:HyperLink ID="linkurl" runat = "server" NavigateUrl ='<%# Eval("Link")%>' Target ="_blank" Text='<%# Eval("Link")%>'></asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
Thanks
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Hi ...
I need to create a hit counter page of our website by which i can see statistic of our website user as daily basis, monthly and weekly basis..
Thnaks,
Abbas
|
|
|
|
|
Create one table with columns: ID,HintCounter,Date and in every page load of masterpage update value by one in table.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
www.aktualiteti.com
|
|
|
|
|
Do you want to track hits or visits because they are 2 very different things?
|
|
|
|
|
What about using Google Analytics[^] ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit Jana wrote: What about using Google Analytics[^] ?
Well, I love this tool. Lately, I have also started using this. But there are still bits and pieces which are missing in this too.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hello,
thanks for providing solution to multiselect dropdown .
I have downloaded the applications and converted it to vs 2005.After conversion the application is running properly but when i copied usercontrol and page
from this application and added to another application i am getting the compilation error mentioned below:
CS0115: 'ASP.webform1_aspx.GetTypeHashCode()': no suitable method found to override
Line 511: Line 512: [System.Diagnostics.DebuggerNonUserCodeAttribute()] Line 513: public override int GetTypeHashCode() { Line 514: return 1203564985; Line 515: }
I am maintaining the same heirarchy and namespace as per original application but unable to resolved it.
Please let me know the solution.
Thanks in Advance!!
|
|
|
|
|
|
Check whether Inherits of your page Directive has proper class that inherits Page or not.
This issue occurs when Inherits doesnt find the Class. The Inherits should be pointing to a class which inherits
System.Web.UI.Page .
|
|
|
|
|
TextBox2.Text = selectedDate.DayOfWeek.ToString();
TextBox3.Text = selectedDate.ToShortDateString();
DateTime sel = selectedDate.AddDays(7);
TextBox2.Text = sel.ToShortDateString();
string connection2 = ConfigurationManager.AppSettings["conn"];
OleDbConnection con2 = new OleDbConnection(connection2);
OleDbDataAdapter da_detail = new OleDbDataAdapter();
DataSet ds_detail = new DataSet();
con2.Open();
//da_detail.Fill(ds_detail, "details");
//DataTable detail_dt = ds_detail.Tables["details"];
string query = "select * from appointment where DATE >= " + selectedDate.ToShortDateString() + " AND DATE<= " + sel.ToShortDateString() + "";
OleDbCommand pay_cmd2 = new OleDbCommand(query, con2);
//DataRow row = null;
//OleDbCommand pay_cmd2 = new OleDbCommand(query, con2);
da_detail.SelectCommand = pay_cmd2;
da_detail.Fill(ds_detail, "details");
DataTable detail_dt = ds_detail.Tables["details"];
GridView1.DataSource = detail_dt;
GridView1.DataBind();
am tryin this but no values are gettin selected.some problem wit the query.the values are in date/time format.plz help
|
|
|
|
|
This is a Repost. Why do you do this ?
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Wrap your date strings in hashes:
string query = "select * from appointment where DATE >= #" + selectedDate.ToShortDateString() + "# AND DATE<= #" + sel.ToShortDateString() + "#";
I would really advise you to write parameterized queries, though.
Read up on it.
var question = (_2b || !(_2b));
|
|
|
|
|
string query = "select * from appointment where DATE >'" + selectedDate.ToShortDateString() + "' AND DATE<'" + sel.ToShortDateString() + "'";
|
|
|
|
|
Hi to all,
I am stucked in a problem. I have a gridview in which there are two button columns.
On button click I want image to open in fax viewer. I tried like this.
But the problem is that the foreach is going through all the rows. I want that if a user clicks on a certain button then it should open the corresponding image.
Please assist me...
<br />
<asp:GridView ID="GridView1" runat="server" BackColor="White" DataKeyNames="UniqueID" <br />
BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" <br />
AutoGenerateColumns="False"><br />
<RowStyle ForeColor="#000000" /><br />
<FooterStyle BackColor="White" ForeColor="#000066" /><br />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /><br />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /><br />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /><br />
<Columns><br />
<br />
<asp:TemplateField HeaderStyle-Width="50px" HeaderText="SrNo" InsertVisible="False" SortExpression="SrNo"><br />
<ItemTemplate><br />
<asp:Label ID="SrNoLabel" runat="server" Text='<%# Bind("SrNo") %>'></asp:Label><br />
</ItemTemplate><br />
<HeaderStyle Width="50px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="50px" HeaderText="UniqueID" InsertVisible="False" SortExpression="UniqueID"><br />
<ItemTemplate><br />
<asp:Label ID="UniqueIDLabel" runat="server" Text='<%# Bind("UniqueID") %>'></asp:Label><br />
</ItemTemplate><br />
<HeaderStyle Width="50px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="50px" HeaderText="BridgeNo" InsertVisible="False" SortExpression="BridgeNo"><br />
<ItemTemplate><br />
<asp:Label ID="BridgeNoLabel" runat="server" Text='<%# Bind("BridgeNo") %>'></asp:Label><br />
</ItemTemplate><br />
<HeaderStyle Width="50px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Left" HeaderText="PlanNo" InsertVisible="False" SortExpression="PlanNo"><br />
<ItemTemplate><br />
<asp:Label ID="PlanNoLabel" runat="server" Text='<%# Bind("PlanNo") %>'></asp:Label><br />
</ItemTemplate><br />
<HeaderStyle Width="50px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="180px" ItemStyle-HorizontalAlign="Left" HeaderText="Description" InsertVisible="False" SortExpression="Description"><br />
<ItemTemplate><br />
<asp:TextBox ID="DescriptionTextBox" Enabled="false" TextMode="MultiLine" runat="server" Text='<%# Bind("Description") %>'></asp:TextBox><br />
</ItemTemplate><br />
<HeaderStyle Width="180px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="50px" HeaderText="OldUniqueID" InsertVisible="False" SortExpression="OldUniqueID"><br />
<ItemTemplate><br />
<asp:Label ID="OldUniqueIDLabel" runat="server" Text='<%# Bind("OldUniqueID") %>'></asp:Label><br />
</ItemTemplate><br />
<HeaderStyle Width="50px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="80px" HeaderText="Image" InsertVisible="False" SortExpression="Image"><br />
<ItemTemplate><br />
<asp:Button ID="ButtonImg" runat="server" Width="80px" ToolTip='<%# Bind("Image") %>' Text="New Image" OnClick="On_Click" ></asp:Button><br />
</ItemTemplate><br />
<HeaderStyle Width="80px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
<asp:TemplateField HeaderStyle-Width="80px" HeaderText="OldImage" InsertVisible="False" SortExpression="OldImage"><br />
<ItemTemplate><br />
<asp:Button ID="ButtonOldImage" runat="server" Width="80px" ToolTip='<%# Bind("OldImage") %>' Text="Raw Image" OnClick="By_Click" ></asp:Button><br />
</ItemTemplate><br />
<HeaderStyle Width="80px"></HeaderStyle><br />
</asp:TemplateField><br />
<br />
</Columns><br />
</asp:GridView><br />
protected void On_Click(object sender, EventArgs e)
{
foreach (GridViewRow rowitem in GridView1.Rows)
{
Button ButtonImg = (Button)rowitem.Cells[6].FindControl("ButtonImg");
btntext = ButtonImg.ToolTip.ToString();
final_text = Server.MapPath(btntext);
}
System.Diagnostics.Process.Start(final_text);
}
cheers,
sneha
|
|
|
|