Showing posts with label select. Show all posts
Showing posts with label select. Show all posts

Wednesday, March 28, 2012

Dynamic Change Between 100 Text Labels

Hello there..

I want to use AJAX dynamic lets get started..

I have 100 Quots that i want AJAX to Random select one and display and after 10 Sec. i want i to select another...

Is that possible? and if yes how??

Hope someone know how to do that..

/MJ Out

Please look at the timer control.

http://ajax.asp.net/docs/tutorials/IntroToTimerControl.aspx

Cheers



BenRush:

Please look at the timer control.

http://ajax.asp.net/docs/tutorials/IntroToTimerControl.aspx

Cheers


Ive tried that.. but how do i define more labels?? and make it random select one? sry for asking but im a noob :)


Anyone? :D Come on.. there is many smart heads in here.. one of them have to know how...

*Bump*

anyone? or isnt it possible

Dynamic Animation

Hi threr;

I want create an show a dynamic animation(exactly like select tag window in this page) using AJAX Control Toolkit animation control. At frist, I dont know how can I create a dynamic animation. Second, I want to call the animation via an event instead of button click.

Hi nima_montazeri,

Check outthis post on how to dynamically create Animations. You can't cause an animation to be played in an event other than those it supports. There is a workaround you could try though. You can create a dynamic OnLoad animation in your event which will play as soon as your page is reloaded - you just have to be careful to clear it out before the next postback.

Thanks,
Ted

Monday, March 26, 2012

DropshadowExtender disappear on gridview selected index changes

Hello,

I have a gridview inside a panel wich is inside an updatepanel. My problem is when I click on my gridview and I select a row the shado and the rounded corners of the panel around the gridview disappear.

I can see the dropshadowextender, only on the first page load, after it disappears. I can't find any solution to keep the rounded corner and the shadow

Please try your scenario with the recently available61121 release of the Toolkit (and ASP.NET AJAX Beta 2). If the problem persists, then please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

Saturday, March 24, 2012

DropShadow on PopupControl rounded corner error

I am trying to add rounded corners to my drop down calendar control but when I select rounded corners on the DropShadowExtender the calendar disappears. (http://www.mtechglobal.com/sample1.jpg)

If I set rounded corners to false, it works fine. (http://www.mtechglobal.com/sample2.jpg)

I'm also seeing a weird problem if I point the dropshadowextender to the Calendar control directly rather than the containing panel. It seems that the shadow is somehow mis-calculating the position of the control. (http://www.mtechglobal.com/sample3.jpg)

Here is my code:

<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:updatepanel id="UpdatePanel1" runat="server">
<ContentTemplate>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="txtFrom" PopupControlID="Panel1" Position="Bottom" />
</atlasToolkit:PopupControlExtender>
<atlasToolkit:DropShadowExtender ID="dse" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="dsBehavior" />
</atlasToolkit:DropShadowExtender>
<center>
<asp:Calendar ID="calFrom" runat="server" BackColor="White" BorderColor="Black" CellPadding="2" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#003399" Width="160px" OnSelectionChanged="calFrom_SelectionChanged" BorderWidth="1px" BorderStyle="Solid" >
<SelectedDayStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
<TodayDayStyle BackColor="#99CCCC" ForeColor="White" />
<SelectorStyle BackColor="#99CCCC" ForeColor="#336666" />
<WeekendDayStyle BackColor="#CCCCFF" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle ForeColor="#CCCCFF" VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#99CCCC" Height="1px" ForeColor="#336666" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#003399" ForeColor="#CCCCFF" BorderColor="#3366CC" Font-Bold="True" />
<DayStyle CssClass="calDay" />
</asp:Calendar>
</center
</ContentTemplate>
</atlas:updatepanel>
</asp:Panel>
<atlasToolkit:DropShadowExtender ID="DropShadowExtender1" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="DropShadowProperties1" />
</atlasToolkit:DropShadowExtender>
Any ideas?oh and ignore the second one of these:
<atlasToolkit:DropShadowExtender ID="dse" runat="server">
<atlasToolkit:DropShadowProperties TargetControlID="Panel1" Width="5" Rounded='false' Opacity=".5" TrackPosition="true" ID="dsBehavior" />
</atlasToolkit:DropShadowExtender>

cut and paste error. :)

dropdownlist inside a update panel is not updating

Hello,
I have a update panel and inside that panel I have three items, dropdownlist, text box and button.
Dropdownlist is being bound to select statement (SqlDatasource) which retrieve list of boxes borrow by department.
Text box is used to updated the information for person name who returned the box.
Button is used when I want to update the information for a retunbox.in the button event handler I update the status of box from borrow to return with the name of the return person and display the information result to end user for success of failure.

I can see the sauces information on the gui and also see the in the database it is updating.
When I refresh the page it remove that box number from the dropdownlist but not when I click the button to update the information. I have set the trigger for updatepanel to conditional mode with button click.

I also try to programatically updated the dropdownlist (both when first time it load the page and on clicking the button) but it still didn't work.

Any help would be really appreciated.

Thanks

F5 refresh doesnot support in Ajax and there is no need for the trigger as the button is already inside the update panel since all child controls are trigger by default

rohit


Thanks.

But the problem still remains same, dropdownlist is not updated once the button is clicked and it has changed the status from borrowed to retuned in the database. Dropdownlist still show the box number as borrowed box.


I assume your button click calls a function.

In that case try to call the update function of the updatepanel.

e.g. <asp:UpdatePanel ID="MyUpdatePanel" .........

Button Click Function:

MyUpdatePanel.Update();

If it's not working, post your HTML here so others can help.

Aeires.


No, this doesn't work.

Here is the code:

<asp:UpdatePanel ID="updatePanelBorrow" runat="server">
<contenttemplate>

<asp:Panel id = "plborrrow" runat="server">

<asp:DropDownList onblur="ResetColor()" id="ddlQABoxList" onfocus="ChangeColor()" tabIndex=3 runat="server" Width="154px" ToolTip="Select SafeGuard No to Borrow it" AppendDataBoundItems="True" CausesValidation="True"><asp:ListItem Value="-1">Choose a SafeGuard</asp:ListItem></asp:DropDownList>

<asp:Textbox id="txtname" runat="server"/>

<asp:Button id="btnSaveBorrow" tabIndex=8 onclick="btnSaveBorrow_Click" runat="server" Text="Save Borrow Info" Width="111px" SkinID="TopPanelSkinID" ToolTip="Update Borrow information for the Safeguard box or QA Box"></asp:Button

</asp:Panel>
</contenttemplate>

</asp:UpdatePanel>

Here is code : first to bind dropdownlist (it is basically box numbers)

public void GetQABoxList()
{
_connection = new SqlConnection(_connString);
//The command object for sql statement
_command = new SqlCommand();
try
{
_connection.Open();
_command.Connection = _connection;
_command.CommandText = "spListOfQABoxes";
_command.CommandType = CommandType.StoredProcedure;

//Execute the insert statemtent

dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = _command;
dataAdapter.TableMappings.Add("Table", "[QA Box]");

DataSet dataset = new DataSet();
dataAdapter.Fill(dataset);

ddlQABoxList.DataSource = dataset.Tables["[QA Box]"].DefaultView;
ddlQABoxList.DataTextField = "boxNo";
ddlQABoxList.DataValueField = "boxNo";
ddlQABoxList.DataBind();

}
catch (Exception exp)
{
Trace.Write(exp.Message);
}
finally
{
_command.Dispose();
_connection.Close();
}
}

Code for button click:

protected void btnSaveBorrow_Click(object sender, EventArgs e)
{
lblMessage.Visible = false;
lblMessage.Text = "";
String boxno = ddlQABoxList.SelectedItem.Text;


_connection = new SqlConnection(_connString);

//The command object for sql statement
_command = new SqlCommand();
try
{
_connection.Open();
_transaction = _connection.BeginTransaction();
_command.Transaction = _transaction;
_command.Connection = _connection;

_command.CommandType = CommandType.StoredProcedure;
_command.CommandText = "spUpdateBorrowBoxInfo";

//Execute the insert statemtent
int val = _command.ExecuteNonQuery();
if (val > 0)
{
plReturn.Visible = false;
lblMessage.Visible = true;
lblMessage.Text = "Borrow information for QA Box # " + boxno + " has been Updated";

// ddlQABoxList.DataSource = dsBorrowBox;
// ddlQABoxList.DataBind();

txtBorrowedName.Text = "";
txtContents.Text = "";
}
_transaction.Commit();
// GetQABoxList();
DataBindDept();
}
catch (Exception exp)
{
lblMessage.Visible = true;
lblMessage.Text = exp.Message.ToString();
Page.SetFocus(ddlQABoxList);
Trace.Write(exp.Message);
}
finally
{
_command.Dispose();
_connection.Close();
}
// GetQABoxList(); use these two lines to enforce to update dropdownlist, NO SUCCESS!
// UpdatePanelAndDDL();
}

it looks like your problem is the dropdown is not refreshing after button click event, for that u need to call GetQABoxList() againg to refresh your dropdown list.

if this is not what you want then please explain your problem more clearly.

Rohit


Well, In the button_Click eventhandler I do call the GetQABoxList() as my primary concern is to get the latest list of qa boxes numbers to bind with dropdownlist. I commnet out this method but it was not working for me.

Thanks


try putting

ddlQABoxList.SelectedIndex = 0 at the end of GetQABoxList() and see if it works for you.


and one thing include

ddlQABoxList.Clear() in the the begining and

ddlQABoxList.SelectedIndex = 0 at the ending

inside the GetQABoxList() subroutine

and make sure there should not be any javascript error shown on ststus bar

i hope it helps

Rohit


Thanks

It work fine with the suggestion you gave.

Wednesday, March 21, 2012

DropDownList causes a full page postback instead of only updating the UpdatePanel

I have a code for updating a DropDownList with items whenever another DropDownList triggers a SelectedIndexChanged event.

When I select an item in the DDLSelect dropdown, it causes a full page postback instead of just updating the UpdatePanel. This problem only occurs when I try to implement it in an existing project, and it works fine when if I try it in a new project.

I've updated my Web.config file to make my project compatible with AJAX, so I don't believe that's the problem.

I should add that I'm trying to use this inside an ascx UserControl file, so maybe there are known issues there.

Thanks in advance.

Please post the usercontrol code

OK, problem solved!

It was the Web.config after all. I had this line which caused the problem:

<

xhtmlConformancemode="Legacy"/>

I removed it and everything is fine.

Cheers.