Showing posts with label dropdownlist. Show all posts
Showing posts with label dropdownlist. Show all posts

Wednesday, March 28, 2012

Multiple UCs on a page

On my page I have two User Controls. One, UC1, has a DropDownList. The other one, UC2, is a list that gets data from a SqlDataSource (datasourcetype=strored procedure), by Repeater.

Whenever the ddl in UC1 is changed, it triggers a function that puts a log record into the database from which UC2 gets the data.

I need the new log record to appear immediately after the selected index of ddl is changed, but it only appears after I refresh the page.

I can't create any triggers for the UpdatePanel of UC1, because the controls are in different UCs.

I tried to use delegates and events, but unsuccessful. My knowledge in that area is limited.

You should be able to use triggers for the update panel even though they are different controls.
Can you post your code?
You can also just refresh the page in code...


Make sure they are both in updatepanels, and set both toUpdateMode="Always". Then, when one updates, the other automatically updates.

Monday, March 26, 2012

multiview refresh inside updatepanel

i've a gridview based on the dropdownlist and multiview with two views based on the gridview selection.

when i change selection in my dropdownlist without click on my gridview, the information in the multiview in view1 and view2 is refreshed, but once i change the selection in my gridview the refresh happend only in the active view not in the other.

help me please

S.O.S ...Sos...sos...helpConfused


thanks to all for your reply!!!Wink.

i've found the solution it's working but i'm sure there is an other way and better.

when i change the selection in the gridview i refresh the sql connection.

and when i set the view1 or view2 to active i refresh the connection too.

gridveiw1.datasourceid="sqlconnectin1".

My first Ajax use

Hello Friends

I am having a DropDownList "lstTitle" that read its values from SqlDataSourse "DSTitles" and a Label "lblNewTitle" i add a java script to the lblNewTitle like that:

lblNewTitle.Text ="<a href='javascript:window.open(\"AddNewTitle.aspx\",\"window\",\"HEIGHT=272,WIDTH=440,top=250,left=250,toolbar=no,scrollbars=yes,resizable=yes\");%20void(0);'>New Title</a>";

so when press on that label a new window appear that enable the user to enter a new title in to my sql 2000 database.

The problem is how to show this new entered title in the lstTitle without a PostPack action.

Note: i add to my page a ScriptManager and and UpdatePanel and put "DSTitle,lstTitle and lblNewTitle" inside the UpdatePanel and use a Timer with an interval of 1 second but nothing change.

So, where is the problem.

Please help me.

Hi.

Label1.Attributes.Add("onClick", "javascript:window.open('Default.aspx',height=272,width=500)");

This will help you.. sure...Remove your first logic and write this intoyour page load event and test it.

Thanks


I just have a script error "Error: 'Sys' is undefined i think the problem is in the following includes:

<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>

Hello,

not answering question, but just throwing an idea out: how about using the modalpopupextender instead of a popup window?


Thanks i found the solution.

I create a new website AJAXEnabledWebsite and but a script manager, UpdatePanel "and but the control inseide" and a Timer with an interval of 9 sec and a Tick event.

Inside Timer event handler i put:

lstTitle.DataBind();

lstTitle.SelectedValue = selected;

Saturday, March 24, 2012

Need CalendarExtender to Render OVER DropDownList - IE6

None of the solutions offered in other threads worked for me. I've included some screen shots below, which demonstrate strange browser positioning behavior:

To clarify, I'm using CalendarExtender controls along with DropDownList controls in the EditItemTemplate of a DetailsView control inside a Panel control, which is the TargetControlId for a CollapsiblePanelExtender, which is ALL INSIDE AN UpdatePanel. Indifferent

INITIAL VIEW

VIEW WHEN CALENDAR IS SELECTED (NOTE THE HORIZONTAL SCROLLING)

VIEW IS CORRECTED BY SELECTING THE LAST MONTH OR NEXT MONTH ARROW (AND HORIZONTAL SCROLLING IS CORRECTED)

This is driving me crazy!

Thanks,

Dave

I am having the same problem, anyone find a solution?
Apparently, the problem is related to the CalendarExtender nested in a control that has a relative position to its parent. It doesn't solve the problem, just an FYI...

-Dave

need HELP

how do i add client-side validation on cascading dropdownlist for ajax ext controls?

i look almost all the post and Google it but i didn't find any post which helps me, any help please?

thanks.

Doesn't a validation control work?

never mind, i implement the customvalidation actually they way i want does not work with RFV

thanks

Wednesday, March 21, 2012

Need Help with Ajax Examples

Hi..

can anybody provide a working example of using the dropdownlist and grid view control and saving the data with a button using AJAX..

please help..

The page requirements:
1) Table/Grid displays a list of states (U.S. states) with a column for the state name and a column that contains a dropdown list of the state's cities.
2) Upon selecting a city, the page will display the city name (and perhaps futher lookup some information specific to the city).

The basic ASP.NET flow here is (using 2.0 here, but works similarly in 1.1 using DataGrid):
1) Create a GridView with a bound column for state and a template column for the DropDownList
2) Create a label to display the city name upon selecting it in the DropDownList.
3) Bind the GridView to an array of state objects (could be bound to many other things as well, but keeping it simple for this example). State contains properties for Name and for Cities.
4) Hookup RowCreated event on the GridView so that we can populate the cities into the particular row's DropDownList.
5) Add postback event for getting the selected city and populating the label with it.

Here's what the aspx code looks like:

<asp:GridView ID="gvStates" AutoGenerateColumns="false"
runat="server" OnRowCreated="gvStates_RowCreated">
<Columns>
<asp:BoundField HeaderText="State" DataField="Name" />
<asp:TemplateField HeaderText="Cities">
<ItemTemplate>
<asp:DropDownList ID="ddlCities"
AutoPostBack="true" runat="server"
OnSelectedIndexChanged="ddlCities_SelectedIndexChanged">
</asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView
<asp:Label ID="lblCity" runat="server" Text="Label">
</asp:Label
And here's the code behind:

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Create states array and bind it to Grid
ArrayList states = new ArrayList();

string[] cities =
new string[] { "Portland", "Salem", "Eugene" };
State state = new State("OR", cities);
states.Add(state);
cities =
new string[] { "Seattle", "Tacoma", "Olympia" };
state = new State("WA", cities);
states.Add(state);

this.gvStates.DataSource = states;
this.gvStates.DataBind();
}
}

protected void gvStates_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (!IsPostBack)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Bind drop down to cities
DropDownList ddl =
(DropDownList)e.Row.FindControl("ddlCities");
ddl.DataSource = ((State)e.Row.DataItem).Cities;
ddl.DataBind();
}
}
}

protected void ddlCities_SelectedIndexChanged(object sender,
EventArgs e)
{
this.lblCity.Text = ((DropDownList)sender).SelectedValue;
}

In Ajax framework,you can place them in a asp:UpdatePanel and specify asynchronous postback in the triggers of the asp:UpdatePanel.

Wish this can help you.