|
If you are populating the Dropdown using client side script(JavaScript), then you cannot read dropdown value at server.
Dropdown clears when page post back.
If you need to read the value, save the selected value of dropdown into the hidden text box, using JavaScript(Before Page Post Back). Now read the textbox value.
|
|
|
|
|
Thanks Aman ....that's a great n working reply....even i was also thinking of the same solution.
CC26
|
|
|
|
|
Hi fellow coders,
I'm trying to do a HTTP GET request but I get this error: Unable to read data from the transport connection.
Below is my code:
Dim web As New System.Net.WebClient
Dim stream As Stream = web.OpenRead(URI)
Dim reader As StreamReader
reader = New StreamReader(stream)
strResult = reader.ReadToEnd
Note I cant do POST as the URI does not support that.
Thank you in advance.
|
|
|
|
|
This question has NOTHING to do with ASP.NET
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
You never do a webclient request in ASP.NET? well, then too bad...
|
|
|
|
|
Just because it's *possible* to do something in ASP.NET, does not make it an ASP.NET question. If I can do it in a winforms app, then it's just a C# question.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Some people are just not helpful are they?
If you got nothing to say, then dont reply!
If I'm wrong then you can at least point me to the right direction, you dont have to sound so rude you know!
|
|
|
|
|
FYI when people are incapable of even working out where to post a question, I point them in the right direction BECAUSE a question asked in the right forum, is more likely to get an answer.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
string strUrl = "http://www.abc.com/a.aspx";
Uri url = new Uri(strUrl);
string strFinal = url.ToString();
WebRequest objWebReq = WebRequest.Create(strFinal);
WebResponse objWebRes = objWebReq.GetResponse();
Stream objStream = objWebRes.GetResponseStream();
StreamReader objStreamReader = new StreamReader(objStream);
string strHTML = objStreamReader.ReadToEnd();
|
|
|
|
|
Hi Aman,
Thank you for your help.
I have tried your solution, but I'm still getting "Unable to read data from the transport connection" at this line objStreamReader.ReadToEnd
The URI is ok though, please advice...
|
|
|
|
|
|
WebClient class wraps all these nicely. So you don't have to use WebRequest or WebResponse explicitly unless it is really required.
|
|
|
|
|
I have a large array of Imagebuttons on an ASPX page, that have the URL set depending upon the value of a variable
The value matches the name of the ImageButton as below. Rather than the convoluted code as below is there a way to somehow dynamically change the button - something like
ImageButton[mapflag].ImageUrl="warning.gif"
if (mapflag == "TV1_ANALOGUE") TV1_ANALOGUE.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_DTT") TV1_DTT.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_DTH") TV1_DTH.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_FM") TV1_FM.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_LINKING") TV1_LINKING.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_ISN") TV1_ISN.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV1_EXTEND") TV1_EXTEND.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV2_ANALOGUE") TV2_ANALOGUE.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV2_DTT") TV2_DTT.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV2_DTH") TV2_DTH.ImageUrl = "warning.gif"; <br />
if (mapflag == "TV2_FM") TV2_FM.ImageUrl = "warning.gif";
Many thanks for any help
|
|
|
|
|
Building a map of strings to buttons is about your only option, unless you have an event and can make the button the tag for the event that causes this to happen
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Thanks Christian
I was afraid that was the case
|
|
|
|
|
hello code project gurus.
i am very new to asp.net i have developed a simple two page website where i can view first page as anonymous where as i need to login to be able to view the second page.
web pages are developed in asp.net 2.0 and sql 2005 my hosting has created a database named xyz and given me server login details
Server Name:HamaraShehar.com,25000
Log In:loginxxx
Password:passwdxxx
now i need to upload this solution to my shared hosting space and see if it works there.
please guide me how to do so.
thanx in advance.
|
|
|
|
|
Well, it depends on the host, if they have SQL Server installed, and how they give you access to it, to set up your DB
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I'm new here, so sorry if i'm in the wrong forum.
I'm in need of a multiple combobox that interact with each other. what i mean is when the user select an item from the first combobox the system show the second combobox with items that is related with the first combobox end it will be stored in the database with the 2 items that the user choosed from the 2 comboboxes
i hope you understand me
thnx!
|
|
|
|
|
Jenfi wrote: I'm new here,
Hi Jenfi, Welcome to the Code Project
Jenfi wrote: I'm in need of a multiple combobox that interact with each other. what i mean is when the user select an item from the first combobox the system show the second combobox with items that is related with the first combobox end it will be stored in the database with the 2 items that the user choosed from the 2 comboboxes
I believe you want to mean interaction of Dropdown List in your web page . Am I correct ?
You can easily implement that, On the Selected Change Index of First Dropdown list , Load the data of Second dropdown list.
Suppose, your first Dropdown contain all the Country name, and on selection of country you want to show the states of that country on the second dropdown list, then call a Stored procedure on selection index changed event of first dropdown list and pass the country name which returns all the state name in a dataset and bind that with second Dropdown list.
Hope this will help you to go ahead.
Please let us know if any more issue.
|
|
|
|
|
i don't want to give my code part of web application to client. In asp.net 2.0 ,i publish the website but there is no publish option in asp.net 1.1
One person's data is another person's program.
--J.Walia
|
|
|
|
|
J walia wrote: i don't want to give my code part of web application to client. In asp.net 2.0 ,i publish the website but there is no publish option in asp.net 1.1
Try this
How do I precompile my ASP.NET 1.1 application[^]
Hope this will help you
|
|
|
|
|
I took advantage of some code I found on these forums and have created a form that has a nested gridview. The first gridview is bound using the SqlDataSource and on the OnRowBound event, bind data to the nested gridview. Then using JavaScript i hide the nested gridview until the user clicks on an image. The code I found for the javascript nested grid view is here. I then added code to highlight the selected row in the the first gridview. What i need to know is how would I go about adding code to make it so that I can do the same for the nested gridview?
Sample code
protected void Page_PreRenderComplete(object sender, System.EventArgs e)
{
//GridView nestedGrid = (GridView)GridView1.FindControl("GridView2");
foreach (GridViewRow y in GridView1.Rows)
{
y.Attributes.Add("onclick", "setSelected(this);");
}
}
function setSelected(selRow)
{
// alert(selRow.rowIndex);
var tbl = document.getElementById("GridView1");
for(var i = 1; i < tbl.rows.length; i++)
{
if(selRow.rowIndex == i)
{
selRow.style.fontWeight = "Bold";
selRow.style.backgroundColor = "Yellow";
}
}
}
But once i moved to child grid that time Click event of parent Grid cell does not fired so all highlited row of parent grid gone.
so how to solve it
Raghvendra
Raghvendra
|
|
|
|
|
Please don't cross post. If you posted the same question, before few hours back.
|
|
|
|
|
OK Next time i will take care , but i request u to ans my problem if no one else
Raghvendra
|
|
|
|
|
I am trying to deploy the ms sql express with my program and attach a mdf file automatically. I read about the attachdbfilename attribute in the connections string but I can't get it to work. Can any one give me some help?
I have looked on Microsoft website and they don't give good examples. Also on Google, I am doing (I think) what I am suppose to but get errors.
Example connections string:
"Data Source=WALZLM1;Initial Catalog=;AttachDBFileName=scantrack.mdf;Integrated Security=True"
I get this error: An attempt to attach an auto-named database for file scantrack.mdf failed. A database with the same name exists, or specified file can not be opened, or it is located on UNC share.
Things you may want to know. The Sqlexpress is on a networked server. The mdf is local.
What am I doing wrong?
I can't think of anything cool and nerdy to say.
|
|
|
|