|
Christopher Duncan wrote: the load time for the web site sucks each time I fire up the debugger because it has to do the jit compilation of the single assembly that contains all pages
What type of project is it? I have a project which has many pages but it starts the debugger pretty quickly.
|
|
|
|
|
|
Hi All,
I need one help regarding gridview,
I placed a dropdownlist inside the gridview for a perticular column let us assume that dropdownlist contains items like Pass,Fail and NA.
from the Database i will get any value(Pass/Fail/NA), now based on this value i want to highlight the dropdown list with corresponding value.
can anybody guid me, how to implement this.
i am doing this asp.net with c#.
|
|
|
|
|
Hi Dayakar,
There is an event of gridview called on RowDataBound. In that event you have to bind the dropdown text with the value i.e. coming from database.
suppose your dropdownlist name is ddlResult
and gridview gvResultSheet
gvResultSheet_RowDataBound( object sender, GridVieRowEventArg e)
{
DropDownList ddlResult;
if (e.Row.RowType == DataControlRowType.DataRow)
{
ddlResult = (DropDownList) e.findcontrol("ddlResult");
if(ddlResult != null && ddlResult.Items.Count > )
{
ddlResult.SelectedValue = yourdatasource value;
}
}
}
add proper code for yourdatasourcevalue.
And let me know if you have some trouble.
|
|
|
|
|
gvResultSheet_RowDataBound( object sender, GridVieRowEventArg e)
{
DropDownList ddlResult;
if (e.Row.RowType == DataControlRowType.DataRow)
{
ddlResult = (DropDownList) e.findcontrol("ddlResult");
if(ddlResult != null && ddlResult.Items.Count > )
{
ddlResultItems.FindByText(yourdatasource value).Selected = true;
}
}
}
try this.
|
|
|
|
|
Thanks Sneha. For adding this in my knowledge base
|
|
|
|
|
I have Page A which when link is clicked sends person to Page B.
When on Page B I want to automatically delete Page A. I am having problems. I tried all page cycles of Page B, including Load_Complete to delete Page A. The end result is I am still stuck on Page A, but receive a page error that page does not exist. (Obviously cause the code in Page B to delete it, deleted it)
Can someone offer me insight as to where on Page B I can successlly load it to completion and in the background delete Page A?
Thanks in Advance
|
|
|
|
|
You appear to have no damn idea what is going on. You cannot delete page A, it does not exist. If you're popping up page b, do a window.close to close the page, but the Page A class instance only exists when Page A is being generated, not while it is viewed.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi All,
I design a Web page, which having a GridView. I am binding another 3 Gridviews to that main Gridview, to show address, phone etc on mouse hover into main Grid.
Now I add a search panel just above to the grid, to search records. And that panel is invisible until u click on that. As soon as you click to show Search linkbutton, I don't know why but whole grid is repaint. I mean it rebind every thing. I made that main grid invisible and making it visible at Prerender to avoid repainting. but still it repaint whole grid.
I am using .Net3.5, Update panel. Please if any body know why it is repainting let me know to solve this problem.
Thank you,
Kam
|
|
|
|
|
If you're using AJAX then the grid should not refresh, unless the AJAX code you're using refreshes it. If you wrote your own AJAX code, you'd have control over this, as it stands, you're stuck with what the ASP.NET controls do.
If it's rebinding, then it's posting back, so I'd assume AJAX is not coming into play. In that case, the answer is, your code is broken. We can't say more without seeing it.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I need to use ajax to handle price calculations based on user selections, i was going to use a checkbox list, but i discovered that i can't seem to get an async postback happening. i have a calendar extender on the page that works perfectly from the Ajax Control Toolkit, but i cant get this simple example to work. Works fine outside of this page/project. I'm using asp.net 3.5 the solution was converted from 1.1 to 3.5 a while ago. I cant post the whole page(rather long) this appears about 650 lines down up top i have
form
div
asp:scriptManager
then some tables some nested
in the row above this i have another dateTime. Now codeblock to see if i can get the dates out of synch which seems to be a standard example on all the sites i've looked at. Regardless of what i do the button in the updatePanel runs a whole postback, i've tried setting triggers, enabling partial rendering(and having it off) setting the children as triggers property, along with the render and update modes. I've read Dino Esposito's book on ajax along with other artciles and anything i can find.
<asp:UpdatePanel ID="JokeUpdatePanel" runat="server">
<ContentTemplate>
<asp:Label ID="JokeText" runat="server"></asp:Label><br />
<br /><%=DateTime.Now %>
<asp:Button ID="NewJokeButton" runat="server" OnClick="NewJokeButton_Click" Text="Show Me a Random Joke!" />
</ContentTemplate>
</asp:UpdatePanel>
I've disabled most of the things i do on page_load event incase it was messing with something now all i do is in the initial load of the page (!page.IsPostBack) and set up a db connection(dont open it just create it), which shouldnt matter. no matter what i try the whole page refreshes, but the demo project i have on the same server runs fine. I've tried the integrated server in VS 2008 sp1, and IIS on my local machine.
Any help would be appreciated, I think it may have something to do with having converted the project but i have no idea what or how to fix it.
John
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
You should set up a update target in the update panel that points to your button control. That'll force the update panel to respond via callback to the button's click event.
|
|
|
|
|
I've tried setting up the triggers on the update panel, as well as ChildrenAsTriggers, i dont see where you can set up a target. The button click will change the text of a text box in the update panel's contentTemplate, and there's a datetime value that refreshes.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Hi...I am trying to implement AJAX autocomplete example....(I tried with the one which is specified on www.asp.net/ajax)....I did exactly what it was mentioned....but still i am getting error:
microsoft jscript runtime error sys.argumentundefinedexception:value cannot be undefined
I am using 3.5 framework,VS2008,AJAXControlToolKit....
Some suggested me to change web.config file....I even did that...but i am getting the same error....
Can anyone help me in this .....If u give any samples to implement that would be much appreciable...
Cheers,
Fast
|
|
|
|
|
Hi..thanks a lot any have i solved it....
Cheers,
fast
|
|
|
|
|
|
I have written a component that uploads a file to the user using Response.Header functionality. The problem is that after doing this, the response is ended = page wont handle more postbacks.. Need to set some predefined variables before it will work, so i thought maybe i could set the values and then perform a popup to the page that generates the download. Like clicking an href with target=_blank
Is it possible to do this from codebehind? (buttonclick)
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
1: How do I specify the width of the individual columns? I can set the overall width but don't know how to adjust the split between the row headers and the data entry/display part.
2: How can I specify the DefaultMode value at runtime, so that depending on how the user navigates to the page it loads in insert, edit, or read-only mode?
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Hi,
I am using Tree view control for navigation. I am using XmlDataSource control as the datasource for the tree view control. I have given below the Xml file content.
<?xml version="1.0" encoding="utf-8" ?>
<Countries>
<continent cont="NorthAmerica" Navigate="Header.aspx">
<country coun="United States of America">
<language lang="English"></language>
<capital cap="Washington D.C"></capital>
<cities city="Chicago"></cities>
</country>
</continent>
<continent cont="Europe">
<country coun="United Kingdom">
<language lang=" English"></language>
<capital cap="London"></capital>
<cities city="Bristol"></cities>
</country>
</continent>
</Countries>
Html source:
<asp:TreeView ID="LeftNavigation" runat="server" DataSourceID="XmlDataSource1">
<DataBindings>
<asp:TreeNodeBinding DataMember="Countries" Text="Countries" NavigateUrlField="Navigate" />
<asp:TreeNodeBinding DataMember="continent" TextField="cont"/>
<asp:TreeNodeBinding DataMember="country" TextField="coun" />
<asp:TreeNodeBinding DataMember="language" TextField="lang" />
<asp:TreeNodeBinding DataMember="captial" TextField="cap" />
<asp:TreeNodeBinding DataMember="cities" TextField="city" />
</DataBindings>
</asp:TreeView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/XMLFile.xml"></asp:XmlDataSource>
Here the binding working fine. But the navigation is not working. I have given the NavigateUrlField="Navigate". "Navigate" is having the url in xml file. Giving the binding error @ runtime. Pls help me!
Tnx.
|
|
|
|
|
chk with Navigateurl property there is anoter property "target."
set that property and try.
|
|
|
|
|
Hello
I have a dropdownlist in edititemtemplate of the gridview. However items are long so the dropdownlist becomes too wide. What I would like to do is to have dropdownlist which is small when it is collapsed and becomes wide when the items are visible. Is it possible? If I make its widht fixed then the items are cut when they are displayed. I would like for the dropdown to become wider.
Thank you.
|
|
|
|
|
you can set the width dynamically using Javascript
function dynamicWidth(evt,conversionFactor){
var selection = document.getElementById('test');
if (!selection.minmax){
selection.minmax=[parseInt(selection.style.width),0];
for (var i=0; i<selection.options.length;i++){
if (selection[i].text.length>selection.minmax[1]){
selection.minmax[1] = selection[i].text.length*conversionFactor;
}
}
}
selection.style.width = (evt?selection.minmax[1]:selection.minmax[0]) +'px';
}
<body>
<select id="test" onclick="dynamicWidth(true,20);" onblur="dynamicWidth (false,20);" onchange="dynamicWidth(false,20);" style="width:50px;">
<option>Option one</option>
<option>Option two which is long</option>
<option>Option three which is longer</option>
<option>Option four which is even more long</option>
</select>
</body>
Make your adjustment to render the control html in this manner...
Abhishek Sur
|
|
|
|
|
I have a dropdowlist, not select. I not that the resulting HTML will be select but how can I apply your solution to dropdownlist? And the dropdownlist is in a usercontrol.
|
|
|
|
|
use Attributes.Add["onclick",
to invoke your function in client end. Well even if the dropdown is inside the user control, in browser it always renders one select. So get your select control from dropdown.clientID and invoke the function. you can use Server tag inside the javascript function to be replaced with client id.
I think you can do that .. If you still unable to do so, I will send you one code for that then.
Abhishek Sur
|
|
|
|
|
hi i am asp.net devloper and i never use asp
i would like to know what need or requirement to devlop a website in asp
please any body suggest me how i can do
i havnt any type of software like i know for php we need php setup while what need for asp.net.
|
|
|
|