|
I make a menu with asp.net.
now there's a problem.
I am Iranian and persian language is right to left. thus the sub-menu should appears in the left of the menu. But I can't set it. Please help me...
Is there any software to make menu for persian language.
|
|
|
|
|
|
Hi, sorry for my bad english, but I'm italian xD!
However,
At this link there is an image that explain you what I want to do.(first look at it!!!)
Link The foto!!
I want when I click on a row of gridview, send me to another page that do see the detail of what I clicked.
For example if I click on the picture of "Alfa Romeo", I must see the detail of the car in another gridview in another page.
The path of the photos is stored in the database in the field 'FotoEsterno'.
Someone can help me?
|
|
|
|
|
for that u have to handle RowDataBound and SelectedIndexChanged Events. Below is the code
protected void gvItems_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect("ToPage.aspx?SelectedItemId=" + gvItems.SelectedDataKey.Value)
}
protected void gvItems_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType==DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(this.gvItems, "Select$" + e.Row.RowIndex));
}
}
Now at ToPage.aspx u have the Id of the Selected Item so you can display the data related to that item as you want to display.
|
|
|
|
|
Waste of time doing a Response.Redirect from a postback event, just use a Hyperlink column.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Waste of time
Yes He is right Try to use ItemTemplate as Mark suggests
If It Helps Click It as Answer
|
|
|
|
|
But the original requirement was to able to click on datarow not any control in the gridview row. thats why i have prvovided that code. please read the requirement carefully.
|
|
|
|
|
Nisha Agrawal wrote: please read the requirement carefully.
Please look at all of the requirements. The image clearly shows and says the OP want to click on a LINK
only two letters away from being an asset
|
|
|
|
|
yes, it's my mistake. I just followed the words that were written in the main post and ignored the one in the image.
|
|
|
|
|
Ok, it works, because when I click the link, it has this value
"http://localhost:3849/progetto/visualizza.aspx?IDModello=24," but now to see the data, including other photos in the DataList , how should I proceed?
|
|
|
|
|
|
"IDModello" is a sql int variable.
When I click on the gridview (see the image I posted),I want to appear a DataList with only the data that I want to ... not all!
|
|
|
|
|
Use a Hyperlink column or a Template column to place the link in the grid
only two letters away from being an asset
|
|
|
|
|
<ItemTemplate>
<asp:LinkButton ID ="LinkButtonemp" CausesValidation="false" Text='<%# Eval("EmployeeName") %>' runat="server" CommandArgument='<% #Eval("EmployeeID")%>' CommandName="View" CssClass="gridlnk"/>
</ItemTemplate>
Append the name/ID to the querystring and redirect it to another page say InfoPage.aspx.In info page Request the query String .With the Help of Query String Get the Data in the InfoPage.aspx.
If It Helps Click It as Answer
|
|
|
|
|
Hi,
do changes in frist column(Viewdetails)
<asp:HyperLink ID="hypTitle" NavigateUrl='<%#"secondpage.aspx?pid="+DataBinder.Eval(Container.DataItem,"picid")%>' Text='<%#DataBinder.Eval(Container.DataItem,"picturename") %>' runat="server" ></asp:HyperLink>
when click the viewdetails column, i pass Querystring("pid") value of current picture.
On second page, get value from querystring("pid"), using to display the picture.
|
|
|
|
|
Good Answer But Try to use pre tags i.e. code block so he can understand easily
If It Helps Click It as Answer
|
|
|
|
|
|
hi all...
plz help me i found error 500 on my web application.
plz somebody help me.
thanx in advance
maujiram
|
|
|
|
|
|
Hello All,
In my ASP.Net application, i am showing a confirmation box using javascript whenever user intends to delete something.
I have written this code in aspx file
function confirmation()
{
if(confirm("Are you sure?")==true)
return true;
else
return false;
}
Then on Page_Load of my codebehind, i am using this:
btnDelete.Attributes.Add("onclick", "return confirmation();")
It is working fine, if user click ok record is deleting and vice versa.
But when i am trying to write same thing for my GridView delete link its not working, i am writting this:
GridView1.Attributes.Add("OnRowDeleting", "return confirmation();");
Can anybody help me? why its not working for GridView_RowDeleting method?
Thanks,
Nagendra.
modified on Thursday, September 24, 2009 7:06 AM
|
|
|
|
|
nagendrathecoder wrote: function confirmation()
{
if(confirm("Are you sure?")==true)
return true;
else
return false;
}
This is messy as hell. Why not just return (confirm("Are you sure?")) ? Why not tell them what they are to be sure if, in case they don't realise what they pushed ?
nagendrathecoder wrote: GridView1.Attributes.Add("OnRowDeleting", "return confirmation();");
I'd guess that it's because you're trying to hook up to a code behind event, not an actual client side event. You could start by reading on the difference between the client and server.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Thanks, i implemented what u mentioned(used just confirm & displaying proper msg).
I also understand that RowDeleting is server side event and onclick is client side.
But i want this functionality to work for GridView too, what can i do?
|
|
|
|
|
try to add itemtemplate in gridview and do it
<ItemTemplate>
<asp:LinkButton ID="Delete" CommandName="Delete"
OnClientClick="return confirm('Are you sure you wish to delete this item?')"
CausesValidation="false"
runat="server" Text="Delete" ></asp:LinkButton>
</ItemTemplate>
If It Helps Click It as Answer
|
|
|
|
|
i am using ItemTemplate rite now Let me try with that OnClientClick.
|
|
|
|
|
If It Helps Click It as Answer
|
|
|
|