|
Thanks for reply.
In this application based on one dropdownlist box value, I am creating required number of dropdownlist box.this I have to do dynamically.
so is their any other way to get the value from dynamically created dropdownlist box.
Regards
Vidhya
|
|
|
|
|
There are many ways to do this functionality
1.you can have a repeater in that repeater control add all your dynamically created dropdowns, if you are showing them in same section then only you can use this .
2. Store the id that you have given to dropdown and check
in the Request object it will give selected value of that dropdown,
But if you are using Master Page/User control then you will have to give client ID,get that one by checking html content of the page.
I hope it will help you
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
modified on Wednesday, May 21, 2008 9:26 AM
|
|
|
|
|
Hey Thanks for Reply.
I think it will help me to solve this issue.
Regards
Vidhya
|
|
|
|
|
Hi Sandeep,
I tried to work out on what u said.but i have not worked on request object and all.
and i am attaching the code which will create the dropdown list dynamically.please let me now how can I access the selected value of this dropdownlist when I click on button.
please help me to resolve this issue.
below is the code to create dropdownlist dynamically.
protected void createddl(int surveyID, int attributeID)
{
ISession session = NHibernateSessionManager.Instance.GetSession();
IQuery attributeValueQry = session.CreateQuery("from MasterValueEntity mve where TypeID='" + attributeID + "'");
IList attributeValueList = attributeValueQry.List();
IQuery labelValueQry = session.CreateQuery("from MASTERTYPEEntity mte where TypeID='" + attributeID + "'");
IList labelValueList = labelValueQry.List();
IQuery hierarchyValueQry = session.CreateQuery("from HierarchyEntity");
IList hierarchyValueList = hierarchyValueQry.List();
DropDownList list = new DropDownList();
list.Items.Add("Select");
Label label1 = new Label();
if (attributeID == 0)
{
label1.Text = "Hierarchy";
label1.Width = Unit.Percentage(60);
label1.Height = Unit.Percentage(50);
foreach (HierarchyEntity hierarchyEn in hierarchyValueList)
{
list.ID = "Hierarchy";
list.Items.Add(hierarchyEn.Hname);
list.Width = Unit.Percentage(65);
}
list.Items.Add("All");
}
else
{
foreach (MASTERTYPEEntity masterTypeEn in labelValueList)
{
list.ID = masterTypeEn.TypeName;
label1.Text = masterTypeEn.TypeName;
label1.Width = Unit.Percentage(60);
label1.Height = Unit.Percentage(50);
}
foreach (MasterValueEntity masterValueEn in attributeValueList)
{
list.AutoPostBack = true;
list.Items.Add(masterValueEn.TypeDesc);
list.Width = Unit.Percentage(65);
}
list.Items.Add("All");
}
PlaceHolder1.Controls.Add(label1);
PlaceHolder2.Controls.Add(list);
session.Close();
NHibernateSessionManager.Instance.CloseSession();
}
Regards
Vidhya
|
|
|
|
|
Hi,
If i put dd/mm/year format in textbox means then how can i convert that ddmmyear format into mmddyear format?
|
|
|
|
|
string mashing, I guess.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for ur reply sir...
But i dont understand ur answer.
So can u give me solution for that problem?
|
|
|
|
|
you have a string, and you want to change it's format, so you need to take the string and reorganise it. use the split method to split based on the / then reorder the three items you get back, to get the format you want. Or just use int.tryparse to get the ints and build a date time from there, if that is what you need.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks for ur reply and i got the answer sir
|
|
|
|
|
Great - glad to help.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
Sorry for that previous post,was only a partial answer. Here is the complete answer
string input = "31/12/2005";
DateTime dt = DateTime.ParseExact(input, "dd/MM/yyyy", System.Globalization.CultureInfo.GetCultureInfo("en-US").DateTimeFormat);
string output = dt.ToString("MMddyyyy");
regards,
Gidon
|
|
|
|
|
Hi,
I have a login page which takes the username and password and connects to the Oracle database. The login details are same as oracle db login details. If the user attempts 5 invalid logins to the application, the user id gets locked in both the application and the database. However, if the user is typing the same wrong invalid password consecutively for 5 times, the user id is not getting locked in the database. This means for the same set of userid and password, the post back is not working. Can you please explain and give a solution? We are using ASP.NET 1.0 with VB.NET. Thanks in advance!
Regards,
|
|
|
|
|
why would it ? I mean, it's still one attempt,right ?
I guess this means some component is doing this, it's not your own code ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
I am using the following statement:
cmdSearch.CommandText = "select doctitle, filename, characterization, hitcount from SCOPE
('" /dotNet "') where FREETEXT ( '" + searchText + "') ";
but it is showing an error for /dotnet, it has a problem with the /
How can I edit the query so it allows the /, is it a banned character so to speak
thanks
|
|
|
|
|
/ is used as an escape character. For example /" is how you put quotes in your string. Putting a @ at the start of the string turns these off, and will fix your code. Or you can use // to escape a /.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for the reply
I am using the article below
http://www.codeproject.com/KB/aspnet/IndexingServer.aspx
and trying to include the following line:
FROM SCOPE(' SHALLOW TRAVERSAL OF ("/", "/Help") ')
but it wont allow me to add it as it says there is a syntax error, why would this be?
thanks!
string selectintranetquery = "select doctitle, filename, vpath, rank, characterization, hitcount
FROM SCOPE(' SHALLOW TRAVERSAL OF ("/", "/Myfile") ') where FREETEXT(Contents, '" + searchText + "') order by rank asc ";
|
|
|
|
|
for the reason I told you, but in reverse. C# can't tell when you mean a " to be in the string, because you're not escaping it.
string selectintranetquery = @"select doctitle, filename, vpath, rank, characterization, hitcount
FROM SCOPE(' SHALLOW TRAVERSAL OF (""/"", ""/Myfile"") ') where FREETEXT(Contents, '" + searchText + "') order by rank asc ";
note that you use "" to get quotes when using @.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
cheers that worked!
thanks
|
|
|
|
|
Christian Graus wrote: / is used as an escape character.
No, it's not. You are thinking of the backslash character: \
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi friends
I have a page where an is present.
Am setting the src of this image dynamically.
If img1.src = "" or empty, i dont want the cross ('X') symbol to be displayed.
Instead, some image which gives some meaning should be displayed.
Can anyone please help me out?
Thanks!
~VSree
modified on Wednesday, May 21, 2008 6:48 AM
|
|
|
|
|
You can't. You need to set the src to the image you want to show. binarywrite only works to send an image through a http handler if you want to show more than just the image.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I have category list in HTML page. when I click on computer category, sub category of computer will be display on HTML page.
e.g.
computer->Intel
Like above there are 4-5 categories under computer. Also there are some main category like cameras,Gifts etc.
Every time when I click some category static HTML page of subcategory called and in that static page bottom of the page string like above(computer->Intel) is display.
This all happening in HTML page.
Now I want to pass computer->Intel string to .aspx page.
How can I do this?
Thanks
|
|
|
|
|
You need to put the values on your link, and read them off the query string.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
1.Passing the value through query string
2.If the action is mapped to the aspx page in your HTML form then you can access the fields through Request object in your aspx page.
i.e something like this..
...
3.I think it can be passed through session also ...but I'm not sure!! Google it.
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|