473,761 Members | 8,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem is displaying values in html select control

375 Contributor
Hi,

I have two controls one html select control and one asp.net dropdownlist control.

In html select control i have three maps loaded. It is loaded in the following manner.
Expand|Select|Wrap|Line Numbers
  1. <SELECT class="TextBoxLabel" id="ddlMap" style="WIDTH: 128px;" tabIndex="1" onchange="fnChangeMap();"
  2.  
  3. name="ddlMap" runat="server">
  4.  
  5.  
  6. </SELECT>
  7.  
  8.  
  9.  
  10. function fnChangeMap()
  11.  
  12.  
  13. if(document.frmLiveTrack.ddlMap.value != 0){
  14.  
  15. var vMap = document.frmLiveTrack.ddlMap.value;
  16.  
  17. var vMapValues = vMap.split(",");
  18.  
  19. for(i=0 ; i < vMapValues.length ; i=i+5)
  20.  
  21. {
  22.  
  23. document.mapping.country.value = vMapValues[i];
  24.  
  25. document.frmLiveTrack.country.value = vMapValues[i];
  26.  
  27. document.frmLiveTrack.country1.value = vMapValues[i];
  28.  
  29. document.mapping.Lat.value = vMapValues[i+1];
  30.  
  31. document.mapping.Lon.value = vMapValues[i+2];
  32.  
  33. document.mapping.scale.value = vMapValues[i+3];
  34.  
  35. document.frmLiveTrack.DefaultURL.value = vMapValues[i+4];
  36.  
  37. }
  38.  
  39. //alert(document.frmLiveTrack.DefaultURL.value);
  40.  
  41. document.mapping.target = "MainFrame";
  42.  
  43. document.mapping.method = "get";
  44.  
  45. document.mapping.action = document.frmLiveTrack.DefaultURL.value; 
  46.  
  47. document.mapping.submit(); 
  48.  
  49. }
  50.  
  51. else{
  52.  
  53. alert("Select a Map");
  54.  
  55. }
  56.  
  57. }
  58.  
  59.  
  60.  
  61. Further i have a function called as load map which is called in page load event
  62.  
  63. private void LoadMap(string strUserId, int iUserType)
  64.  
  65. {
  66.  
  67. this.loadmapval = "Dhanus";
  68.  
  69. string text1 = "";
  70.  
  71. DataSet set1 = new DataSet();
  72.  
  73. ConnectionCls cls1 = new ConnectionCls();
  74.  
  75. text1 = TrackQuery.getMapQry(strUserId, iUserType);
  76.  
  77. set1 = cls1.dsGetValues(text1);
  78.  
  79. string text2 = base.Request.Params["country"];
  80.  
  81. if (iUserType == 1)
  82.  
  83. {
  84.  
  85. this.ddlMap.Visible = true;
  86.  
  87. this.lblCountry.Visible = false;
  88.  
  89. if (set1.Tables[0].Rows.Count > 0)
  90.  
  91. {
  92.  
  93. for (int num1 = 0; num1 < set1.Tables[0].Rows.Count; num1++)
  94.  
  95. {
  96.  
  97. DataRow row1 = set1.Tables[0].Rows[num1];
  98.  
  99. string text3 = Convert.ToString(row1["MAPNAME"]);
  100.  
  101. text3 = text3 + "," + Convert.ToString(row1["MAPLAT"]);
  102.  
  103. text3 = text3 + "," + Convert.ToString(row1["MAPLONG"]);
  104.  
  105. text3 = text3 + "," + Convert.ToString(row1["MAPSCALE"]);
  106.  
  107. string text7 = text3;
  108.  
  109. text3 = text7 + "," + Convert.ToString(row1["MAP_URL"]) + "/" + Convert.ToString(row1["ENGINE_DEFAULT_URL"]);
  110.  
  111. if (text2.Equals(Convert.ToString(row1["MAPNAME"])))
  112.  
  113. {
  114.  
  115. this.strMapDetail = text3;
  116.  
  117. }
  118.  
  119. this.ddlMap.Items.Add(new ListItem(row1["MAPNAME"].ToString(), text3));
  120.  
  121. }
  122.  
  123. }
  124.  
  125. }
  126.  
  127. else if (iUserType == 2)
  128.  
  129. {
  130.  
  131. this.ddlMap.Visible = true;
  132.  
  133. this.lblCountry.Visible = false;
  134.  
  135. if (set1.Tables[0].Rows.Count > 0)
  136.  
  137. {
  138.  
  139. for (int num2 = 0; num2 < set1.Tables[0].Rows.Count; num2++)
  140.  
  141. {
  142.  
  143. DataRow row2 = set1.Tables[0].Rows[num2];
  144.  
  145. string text4 = Convert.ToString(row2["MAPNAME"]);
  146.  
  147. text4 = text4 + "," + Convert.ToString(row2["MAPLAT"]);
  148.  
  149. text4 = text4 + "," + Convert.ToString(row2["MAPLONG"]);
  150.  
  151. text4 = text4 + "," + Convert.ToString(row2["MAPSCALE"]);
  152.  
  153. string text8 = text4;
  154.  
  155. text4 = text8 + "," + Convert.ToString(row2["MAP_URL"]) + "/" + Convert.ToString(row2["ENGINE_DEFAULT_URL"]);
  156.  
  157. if (text2.ToUpper().Equals(Convert.ToString(row2["MAPNAME"]).ToUpper()))
  158.  
  159. {
  160.  
  161. this.strMapDetail = text4;
  162.  
  163. }
  164.  
  165. this.ddlMap.Items.Add(new ListItem(row2["MAPNAME"].ToString(), text4));
  166.  
  167. }
  168.  
  169. }
  170.  
  171. }
  172.  
  173. else
  174.  
  175. {
  176.  
  177. this.ddlMap.Visible = true;
  178.  
  179. this.lblCountry.Visible = false;
  180.  
  181. if (set1.Tables[0].Rows.Count > 0)
  182.  
  183. {
  184.  
  185.  
  186. if (set1.Tables[0].Rows.Count > 0)
  187.  
  188. {
  189.  
  190. for (int num3 = 0; num3 < set1.Tables[0].Rows.Count; num3++)
  191.  
  192. {
  193.  
  194. DataRow row3 = set1.Tables[0].Rows[num3];
  195.  
  196. string text5 = Convert.ToString(row3["MAPNAME"]);
  197.  
  198. text5 = text5 + "," + Convert.ToString(row3["MAPLAT"]);
  199.  
  200. text5 = text5 + "," + Convert.ToString(row3["MAPLONG"]);
  201.  
  202. text5 = text5 + "," + Convert.ToString(row3["MAPSCALE"]);
  203.  
  204. string text9 = text5;
  205.  
  206. text5 = text9 + "," + Convert.ToString(row3["MAP_URL"]) + "/" + Convert.ToString(row3["ENGINE_DEFAULT_URL"]);
  207.  
  208. if (text2.Equals(Convert.ToString(row3["MAPNAME"])))
  209.  
  210. {
  211.  
  212. this.strMapDetail = text5;
  213.  
  214. }
  215.  
  216. this.ddlMap.Items.Add(new ListItem(row3["MAPNAME"].ToString(), text5));
  217.  
  218. }
  219.  
  220. }
  221.  
  222. }
  223.  
  224. else
  225.  
  226. {
  227.  
  228.  
  229. StringBuilder builder1 = new StringBuilder();
  230.  
  231. builder1.Append("SELECT MAPNAME FROM MAP_SUPERUSER ");
  232.  
  233. builder1.Append(" WHERE ");
  234.  
  235. builder1.Append(" SUPERUSERID = (SELECT SUPERUSERID ");
  236.  
  237. builder1.Append(" FROM USERS WHERE USERID='" + strUserId + "')");
  238.  
  239. builder1.Append(" AND DEFAULT_MAP ='1'");
  240.  
  241. string text6 = (string)cls1.ExecuteScalar(builder1.ToString());
  242.  
  243. this.lblCountry.Text = text6;
  244.  
  245. this.strCountry = text6;
  246.  
  247. }
  248.  
  249. this.ViewState["COUNTRY"] = this.strCountry;
  250.  
  251. }
  252.  
  253. }
Now to my problem, when I choose any values from the dropdownlist1, the values in the html select control called ddlmap gets vanished.

eg. if there are three values 1,2,3 by default the value 1 is displayed on the select control and the values 2,3 are in the dropdown area whereas when i choose the value from dropdownlist(se rver control) nothing is displayed. The select control is empty and all the values 1,2,3 are in dropdown area.



i tried giving ddlmap.Selected Index = 1;

but to no avail.





Kindly help please



Regards

cmrhema
Mar 12 '08 #1
0 1519

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2596
by: Jeff | last post by:
IDE: VS 2003 :NET OS: XP Pro My app have a form with a tab-control on it. The tab-control have 2 tabpages. One of the tabpages displays a datagrid, and the other tabpage displays details (order date, name, address etc) about the selected row in the datagrid... My problem is when I enter a new record in the details tabpage (saves data to database), and go back to the datagrid. Only the data from the PM-table
5
4230
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1); System.Data.SqlClient.SqlCommand dbCommand1 = new System.Data.SqlClient.SqlCommand();
0
2092
by: nate | last post by:
the error returned is this: Server Error in '/AnnAccRpt' Application. -------------------------------------------------------------------------------- Could not find control 'DropDownList1' in ControlParameter 'DropDownList1'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
2
2962
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import namespace="System.Web.UI.WebControls" %> <%@ import namespace="System.Data" %> <%@ import namespace="System.Data.OleDb" %>
2
3156
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button then the calender gone actually i want if i click outside off the calender then it should me removed ..How kan i do this ... Pls inform me as early as possible .. I am waiting for ur quick replay ...Here i attached the source code .... <!DOCTYPE...
11
1643
by: kavithadevan | last post by:
Hi, Here i pasted Three scripts first one is displaying the details which i have stored in database this is working but in second script is in link with first one if i click main.php it displays all the details in the database if i click one particular detail i want to see the details about that( so i gave link in main.php scriptl).Here i mentioned some sql line i got some problem from there $edit="select subject from...
0
1516
by: paragguptaiiita | last post by:
I have one problem regarding displaying text from XML file. I have a XSL variable named $p = (0 0 0) (0.82 0 0) (1.63 -0.01 0) (2.63 -0.01 0) (3.63 -0.01 0) (4.63 -0.01 0) (5.63 -0.02 0) (6.63 -0.02 0) (7.63 -0.02 0) (8.6 -0.02 0) This line contains X,Y,Z coordinates of 10 points. for displaying each coordinate in a separate line.Like this.... (0 0 0) (0.82 0 0) (1.63 -0.01 0) (2.63 -0.01 0) (3.63 -0.01 0) (4.63 -0.01 0)
7
6669
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a tabcontainer which has 1 panel already, however I want to try create the TabPanels dynamically. I followed the advice here: http://www.asp.net/learn/ajax-videos/video-156.aspx (3rd comment - Joe Stagner)
2
2218
coolv
by: coolv | last post by:
Hello I have problem in my page that the dropdown box is not displaying data according to selection of first dropdown.Please help me. Below is my code. thanks.............. <?php session_start(); if (!isset($_SESSION)) {
0
9522
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10111
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9948
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9902
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6603
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.