|
I took advantage of some code I found on these forums and have created a form that has a nested gridview. The first gridview is bound using the SqlDataSource and on the OnRowBound event, bind data to the nested gridview. Then using JavaScript i hide the nested gridview until the user clicks on an image. The code I found for the javascript nested grid view is here. I then added code to highlight the selected row in the the first gridview. What i need to know is how would I go about adding code to make it so that I can do the same for the nested gridview?
Sample code
protected void Page_PreRenderComplete(object sender, System.EventArgs e)
{
//GridView nestedGrid = (GridView)GridView1.FindControl("GridView2");
foreach (GridViewRow y in GridView1.Rows)
{
y.Attributes.Add("onclick", "setSelected(this);");
}
}
function setSelected(selRow)
{
// alert(selRow.rowIndex);
var tbl = document.getElementById("GridView1");
for(var i = 1; i < tbl.rows.length; i++)
{
if(selRow.rowIndex == i)
{
selRow.style.fontWeight = "Bold";
selRow.style.backgroundColor = "Yellow";
}
}
}
But once i moved to child grid that time Click event of parent Grid cell does not fired so all highlited row of parent grid gone.
so how to solve it
Raghvendra
modified on Tuesday, June 30, 2009 12:06 PM
|
|
|
|
|
Hi all,
I have 2 questions about CSS for my ASP.Net app. (I'll admit this is heavily CSS skewed rather then ASP.Net, but it seems the most appropriate forum?)
1) I have a div inside another div. I have used CSS to position the inner div above the outer div so that I can make something appear to pop up on postback. This works fine in IE, but in other browsers it seems to stop me clicking on any control inside the inner div. Does anybody have any idea what I can do to avoid this problem?
2) If there is a disabled button on the form, what is the CSS to stop the font from appearing embossed? I can already change the basic appearance of the button, but I'm having problems when the button is disabled - any ideas?
Thanks in advance,
Chris
[Edit: It has been pointed out that this should be in the Web Development forum. I'm not going to delete this post so that it can be referenced later.]
[Edit 2: I have now found the solution to (1) - I accidently had an invisible div above the rest of the page - I used a px measurement rather then a % by accident in my CSS]
modified on Wednesday, July 1, 2009 4:34 AM
|
|
|
|
|
c2423 wrote: I'll admit this is heavily CSS skewed rather then ASP.Net, but it seems the most appropriate forum?
No, it is not. Web Development forum is more appropriate.
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.
|
|
|
|
|
Oops - my bad. You are quite right. If anybody is able to move it there I'd appreciate it!
Thanks,
Chris
|
|
|
|
|
c2423 wrote: If anybody is able to move it there I'd appreciate it!
AFAIK : There is no such privilege to any member to move the post from one from to another forum.
So, you have to do it your own
|
|
|
|
|
Not my day for forum navigation today it seems! I'll move it tomorrow.
Thanks,
Chris
|
|
|
|
|
when i download the file which is in arabic name and extension is .txt when i click on download button iam getting the arabic file name with junk characters and the file content is coming with aspx code
how to solve this problem
|
|
|
|
|
Where is the code for download ?
|
|
|
|
|
Response.AppendHeader(Content-Disposition", "attachment; filename=" +Server.UrlPathEncode(EncodeFile));
Sabrysoft
student at Faculty of Computers and Information(FCI)
4th year Computer scince Department
helwan University
Egypt
|
|
|
|
|
Greetings. I am trying to build a form with one listbox and one drop-down list.
For the listbox, I'd like the user to only be able to select 3 items. Is there any way to limit that? I'd also like the other control to be blanked out once the user selects something from the other control. I am able to do this for the listbox with onSelectedIndexChanged since only one selection is made, but if I do this for the Listbox it seems to trigger a postback each time. I was hoping for just the equivalent of OnFocus. Is this possible in .NET or would I have to use JavaScript?
And does anyone have any good code snippets for either of these?
Thanks in advance.
|
|
|
|
|
mjc225 wrote: I am able to do this for the listbox with onSelectedIndexChanged since only one selection is made, but if I do this for the Listbox it seems to trigger a postback each time.
Change the ListBox SelectionMode = Multiple , Put the ListBox inside Update Panel , Use One Counter- Maintain the Counter Value in ViewState ,Now onSelectionIndexChaged , Increase the count and Update the ViewState , Check the value on every partial post back, If its greater than three show message.
Hope this will help you !
|
|
|
|
|
I want to call .cs function from the .aspx page how can i call the function
Thanks,
|
|
|
|
|
hi Amit,
You can call a .cs function from .aspx page. But, what sort of a function has to be called - is it a build in function from cs library or a function created by you? If it is a build in library method, just include the namespace like how you include normally.
using System.Collections.Generic;
Now, if it is a method that you defined in your own class, you just need to make sure that you save the cs class under App_Code folder in your asp project.
Good Luck.
|
|
|
|
|
|
Well, ideally you should use a web service for this.
But, if it is a no go and you still want to follow this approach you can google for PageMethods.
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.
|
|
|
|
|
I created a simple web site with one page, and moved it onto a win2003 server. When I try to hit the page from another machine, I get a 403 error. Why?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Good Day Sir John
How did you host it on the IIS , Please give us more info so that we can help.
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.somee.com
http://www.vuyiswamaseko.tiyaneProperties.co.za
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
John Simmons / outlaw programmer wrote: created a simple web site with one page, and moved it onto a win2003 server.
How did you deployed the site on IIS?
John Simmons / outlaw programmer wrote: When I try to hit the page from another machine, I get a 403 error. Why?
Your are trying to access by http://ipAddress/VirtualDir/Yourpage.aspx ?
|
|
|
|
|
Enable anonymous access for your site at IIS.
|
|
|
|
|
Hi,
Given below is the main aspx file in which the HTML Framework related code snippets are there:
<frameset rows="8%,*">
<frame src="Header.aspx" />
<frameset cols="20%,*">
<frame name="TreeView" src="TreeViewMenu.aspx" />
<frameset rows="36%,*">
<frame name="Parameters" src="ErrorPage.aspx" />
<frame name="DataDisplay" src="DataDisplay.aspx" />
</frameset>
</frameset>
</frameset>
TreeViewMenu.aspx page contains a tree view to which, Hierarchical Nodes are added dynamically. The issue that I am facing is that every time I click on a Node Item, the whole TreeView is re-loaded and Nodes are collapsed. Is there a way to avoid the re-loading of Tree node items / preserving the state of Tree Nodes? Please Help.
TreeViewMenu.cs code:
public partial class TreeViewMenu : System.Web.UI.Page
{
private const string cFrameName = "Parameters";
private const string cErrorPage = "ErrorPage.aspx";
protected void Page_Load(object sender, EventArgs e)
{
this.SaveTreeViewState();
NodeHelper.BuildTreeView(this.TreeView1);
this.RestoreTreeViewState();
}
protected void TreeView1_SelectedNodeChanged(object sender, EventArgs e)
{
this.SaveTreeViewState();
string strSelected = ((TreeView)sender).SelectedNode.Value.ToString();
string strNavigateURL = ((TreeView)sender).SelectedNode.ToolTip.ToString();
if (strNavigateURL.Length > 0)
{
Response.Write("<script>window.open('" + strNavigateURL + "','" + cFrameName + "');</script>");
}
else
{
Response.Write("<script>window.open('" + cErrorPage + "','" + cFrameName + "');</script>");
}
}
#region Private Procedures
private void SaveTreeViewState()
{
if (IsPostBack)
{
List<string> ExpandedList = new List<string>();
NodeHelper.SaveTreeViewState(TreeView1.Nodes, ExpandedList);
Session["TreeViewState"] = ExpandedList;
}
}
private void RestoreTreeViewState()
{
if (IsPostBack)
{
List<string> ExpandedList = (List<string>)Session["TreeViewState"];
NodeHelper.RestoreTreeViewState(TreeView1.Nodes, ExpandedList);
}
}
#endregion
}
|
|
|
|
|
Hello,
Win App:
takes a value from a textbox1 and send it throw parameter to a method in the website called WebDisplay(textbox1.text)
Web App:
WebDisplay method recives the parameter.
so how can i do that..?
thanks!
|
|
|
|
|
This is considered rude. You already posted the question in C# forum.
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.
|
|
|
|
|
Very simple.
WinApps <-> Talks to something <-> Web Apps
"Talks to something" can be any storage
It may be a database, can be a text file, can be xml, etc. any datasource or medium that will communicate.
It can even be a web service, a WCF service,windows service etc.
A few months back I made a web tutor where I has to used windows service.
I implemented this concept there.
Hope this concept helps you.
For any further clarification, please ask me.
Niladri Biswas
|
|
|
|
|
Ok..can u send me 2 app.
Win App that sends paramter to the web app and the web.
Thanks
|
|
|
|
|
Mtyb wrote: takes a value from a textbox1 and send it throw parameter to a method in the website called WebDisplay(textbox1.text)
You want it will automatically display on web page or It will display after some event fired on Web page.
|
|
|
|