Showing posts with label frnds. Show all posts
Showing posts with label frnds. Show all posts

Monday, March 26, 2012

Problem about area of focus

Hello frnds,

I have created Web application using AJAX control tool kit......you may view it here......

www.calstate.edu/majors


My problem here is that If I select 1 item from DropDownList(DDL) 1 and then choose DDL2 and then press search button; everything works fine.....

But now If I select other item from DDL1 again, so I want the DDL2 to be set to default value as Before ie. I want it to be to Select Major Type/Degree....so what shud be added in order to change the default value of DDL2 back to original.


Thanks ur help is highly appreciated

Hemil.

write a event for DDL1's selectedindexchanged and set the ddl2's selectedindex to 0.

And also mark enableautopostback to true for ddl1


hi,

After seen the site I think the problem is that the selected value of second DDL is remain as it is so after the search result of in the selected index chnage event of first DDL just make the SelectedValue to default means index to 0 every time then it will be work


I tried changing the same, but When I write the line in the function

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)

it says cannot assign to majorDDL_SelectedIndexChanged becoz it is a method grp.......so where shud I write the value 0....


Could you please share your code?


C-sharp file

protected void majorDDL_SelectedIndexChanged(object sender, EventArgs e)
{
visibleOff();
searchButton.Enabled = false;

}

.aspx file

<ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" /
<label for="majorDDL" style="display:none;">Select Programs Name and Type:</label><asp:DropDownList ID="majorDDL" runat="server"
OnSelectedIndexChanged="majorDDL_SelectedIndexChanged"
AutoPostBack="True">
</asp:DropDownList
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown1" runat="server"
ServiceMethod="GetDropDownContents"
UseContextKey="True"
Category="major"
LoadingText="..."
PromptText="Degree Major/ Program Name"
ServicePath="MajorsDatabase.asmx"
TargetControlID="majorDDL">
</ajaxToolkit:CascadingDropDown>
<br /><br />
<label for="typeDDL" style="display:none;">Select Programs Name and Type:</label>
<asp:DropDownList ID="typeDDL" runat="server"
OnSelectedIndexChanged="typeDDL_SelectedIndexChanged" AutoPostBack="True">
</asp:DropDownList>

<ajaxToolkit:CascadingDropDown ID="CascadingDropDown2" runat="server"
ParentControlID="majorDDL"
Category="type"
ContextKey="..."
PromptText="Degree Major/ Program Type"
ServiceMethod="GetDropDownContents"
ServicePath="MajorsDatabase.asmx"
TargetControlID="typeDDL">
</ajaxToolkit:CascadingDropDown


I want to make DROPDOWN 2 value to default ie it shud display the value of PromptText="Degree Major/ Program Type".......


I suppose this is automatically handle by extender

http://asp.net/ajax/ajaxcontroltoolkit/samples/

Saturday, March 24, 2012

Problem In CollapsablePanel Extender

Hi Frnds,

I m new to Ajax, and i m using some toolkit extenders for my application.

When i declared a Label and an Image in the Header Panel of a CollapsablePanelExtender, its displaying controls on separate lines.

but i want to display label on the left side and image on right side.

Is there any tech to do like this since its taking more space and looking bad.

thanks in advance

Regards

Hasan

Hi Hasan,

I think you problem is a CSS related issue. Actually, itemplate header works as a div container but it is not recommended to changes its CSS directly. We suggest that you add another container (div) and add css style to the newly added container. For example,

<div style="width: 100%;">
<asp:Label ID="Label1" runat="server" Text="Label" Style="float: left"></asp:Label>
<asp:Button ID="Button2" runat="server" Text="Button" Style="float: right" /></div>

Another way is using a Table to control its showing position.

Best regards,

Jonathan