|
How to make DropDownList in property window for usercontrol ? I would like to chose values form DropDownList in property window for my control but i dont have any idea how to do it, please help
StonePit
|
|
|
|
|
Ok answer is enum
StonePit
|
|
|
|
|
Quick question..I am having tough time trying to access a button (from JavaScript function) that is binded to an item template of a datalist control. This datalist is part of a user control (.ascx) and the user control is dragged and dropped on the webpartzone control on the web page. Any suggestions would be appreciated.
I am trying to access this button from JavaScript to do some client side validations.
Thanks.
|
|
|
|
|
I m using detailsview to update a record.
It contains 2 dropdown lists. one is populated from seperate table. depending on selected value of first drop down list i need to populate second one. selected values of these dropdown lists are updated in table. drop down lists pulls data from two seperate tables. and the values are updated in third one.
Can any body help how this should be done....
Thanks
|
|
|
|
|
Hi,
here i have described it for two dropdown list.
Like wise try for 3 drop downlist.
create two dropdownlist as "ddlParent" and "ddlChild".
Populate the "ddlParent" using
if(!Page.IsPostBack)
{
SqlDataAdapter ad = new SqlDataAdapter("SELECT PersonID FROM Person",myConnection);
DataSet ds = new DataSet();
ad.Fill(ds,"Person");
ddlParent.DataSource = ds;
ddlParent.DataTextField = "PersonID";
ddlParent.DataValueField = "PersonID";
ddlParent.DataBind();
}
Now in the selectedIndexChanged event of the "ddlParent" you will implement the code that will fill the "ddlChild".
private void ddlParent_SelectedIndexChanged(object sender, System.EventArgs e)
{
int personID = Convert.ToInt32(ddlParent.SelectedItem.Value);
string query = "SELECT PhoneNumber,PhoneID FROM Phone WHERE PersonID = "+personID;
SqlDataAdapter ad = new SqlDataAdapter(query,myConnection);
DataSet ds = new DataSet();
ad.Fill(ds,"Phone");
ddlChild.DataSource = ds;
ddlChild.DataTextField = "PhoneNumber";
ddlChild.DataValueField = "PhoneID";
ddlChild.DataBind();
}
Hope it will give an idea.
Happy Coding,
With Regards
Satips
|
|
|
|
|
hi,
i need project ideas in asp.net. i need challenging asp.net project ideas. please help.
love,
lavanya.
|
|
|
|
|
That's a bit vague. Why do you need a project idea? For what purpose is the project? If it is for your own education, what things are you interested in?
|
|
|
|
|
How about a Mars Rover control panel in asp.net
That should be challenging.
"a fool will not learn from a wise man, but a wise man will learn from a fool"
"It is hard to fail, but it is worse never to have tried to succeed." - Theodore Roosevelt
"Success is going from failure to failure without losing your enthusiasm." - Winston Churchill
My Website || My Blog
|
|
|
|
|
hi lavanya
you refer www.dotnetspider.com..
u get ideas in project
thanx
|
|
|
|
|
Hi,
I'm using a pop-up window to display a contact form. This same window is re-used to contact various departments.
So for example a user clicks a link to contact Department 1, a window pops up with a contact form. Now the user changes their mind and clicks to contact Dept 2. The form is reloaded with the necessary contact details.
The problem here is that the pop-up window is pushed to the background due to the main page doing a postback. I need to be able to bring the pop-up window back to the foreground when this happens / when the content of the pop-up window is reloaded / refreshed.
Can anyone help me with this please?
Thanks!
|
|
|
|
|
My Suggestion is better go for AJAX technology instead of posting back your main page.Even if the cotent of the pop window is reloaded it will still remain in the front.There will not be any dependency between Main page and Pop up window.
|
|
|
|
|
Can anyone know how we get selected node of TreeView Control using Java Script.
Any idea please.
I need it terriply.
Know Yourself Then Grow Yourself.
|
|
|
|
|
hi i am trying to create a website with dynamic links.
my idea is to use a datalist and link it wit my ms sql database
so depending on how many records i have in my ms sql database it would have the same amount of links created.
also i would like the links to be images which names can be found in the same ms sql database.
is this possible? would any one please guild me on how to do this as i saw many web site wit this feature and would like to learn them pls
|
|
|
|
|
Put a repeater into your page, define how each row looks and then bind your data from db to the repeater.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
a repeater will be a good choice for ur problem. datlist is used if u need to make changes to the data. since u just need some links to another page, it is always better to use repeater.
love,
lavanya
|
|
|
|
|
Hi,
Yes repeater is an good option.
You can do it as:
Code:
qrystr = "select link_text,url from url_links"
adaplnk = New SqlDataAdapter(qrystr, conn)
adaplnk.Fill(drlnk)
y = drlnk.Rows.Count
Repeater2.DataSource = drlnk
Repeater2.DataBind()
Design:
<%if y> 0 then%>
< asp:repeater id="Repeater2" runat="server" >
< ItemTemplate >
< a target="_blank" href="<%#DataBinder.Eval(Container.DataItem, "url")%>" class="popurl" > < IMG height="11" src="images foldername/<%#DataBinder.Eval(Container.DataItem, "link_text")%>" width="14" border="0 >< /a >< /ItemTemplate >
< /asp:repeater >
<%end if%>
Know is Drop, Unknown is Ocean
|
|
|
|
|
ok i will try it out thx for the help i will post again if i got any other question regarding the repeater =)
|
|
|
|
|
I want to get information of this web page: http://www.bidv.com.vn/BSC/op.htm by asp.net and save it into database for later process but it use frame so i can't do. Anybody know how please help me. I really need it. Thanks
|
|
|
|
|
In ASP.NET if a application is using Form Authentication ,and if the user skips the login page and directly tries to browse the inner page using its link what will happen?Will the authentication be violated by the user?
|
|
|
|
|
The user will be redirected to login page as in Web.config
|
|
|
|
|
Hi,
If in the web.config file, you set authentication to Forms and LoginUrl to Login.aspx....and authorization deny users "?" ......Then client cannot go to other page without first going to Login.aspx.
Hope helped.
Happy Programming.
Sanjeev
|
|
|
|
|
i want biuld a tree view in asp.net(c#)visual studio 2003 and i want bind it from database how can u help me? i dont know how should i start
|
|
|
|
|
You can start with the control tutorials/documentations/examples.
|
|
|
|
|
I have a simple VB ASP.NET 2.0 page with a Button and a Label.
The Label text is "0". For each click of the button (btnAdd), it should
increment the Label text by 1.
The code:
Protected Sub btnAdd_Click(...) Handles btnAdd.Click<br />
Trace.Warn("Before add: " & lblCounter.Text)<br />
lblCounter.Text = (Int32.Parse(lblCounter.Text) + 1).ToString<br />
Trace.Warn("After add: " & lblCounter.Text)<br />
End Sub<br />
However, each time I click the button, the label always increase by 2 instead of the expected 1. What's the problem area?
I tried to debug using Trace.
I get the following result from the trace:
Begin Raise PostBackEvent
Before add: 0
After add: 1
Before add: 1
After add: 2
End Raise PostBackEvent
Is this signifies PostBack event is being run twice per button click?
How to solve it?
Thanks for your assistance.
Pedestrian, Penang.
|
|
|
|
|
hi,
i tried the same code out. i didnt get any probs as u mention. my code is here.
Protected Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Label1.Text = Val(Label1.Text) + 1
Label1.Text = (Int32.Parse(Label1.Text) + 1).ToString
End Sub
c there is no difference. but i am not having any probs. the out put is first 1 then 2 then 3 etc. i am not getting any result incremented by 2. c if u have all the property values correct.
love,
lavanya
|
|
|
|