|
i have two select boxes. sb1 and sb2. Sb1 is getting bind on page load with "project names"(field name)
Now there is another 3rd html control (html ddl, "select") which consist of name of managers.
Now onchange event of this 3rd ddl i am calling an ajax function which is retrieving data through xmlhttp and binding the sb2 with that (means assigned projects to the selected manager)
Now i am again using another ajax function to add new item from sb1 to sb 2 on a html button click.
Which is updating the new project to the projectassigned table into the account of that manager.
And sending the updated records for that manager, back, as response text .Its displaying into the sb2 with the updated recodrs. everything is fine till here.
BUT , NOW IF I AGAIN SELECT ANOTHER MANAGER AND THEN SELECT THAT MANAGER , ITS NOT GOING TO THE PAGE LOAD ON READYSTATECHANGE FOR THE LAST ITEM IN THE 3RD HTML DROP DOWN....It is shiowing the previous data .Even after updation.
for the last item selection , this thing is happening. but its showing the correct data for all other items other than item at the last index.....
Kindly suggest me , where m i doing the mistake....if u wish , i can send u the code also......
My id is
ajit@omniesolutions.com
hgdfytdygjhtdyrdjfjyryfrxjyryrxjyfxjrxyrxrxyrxrxrxyr
|
|
|
|
|
there may be problem of CACHING on server for page request
try sending one more querystring parameter for XMLHttpRequest.... idea is to use a time stamp with it...
just give it a try..
Ashish Sehajpal
|
|
|
|
|
I've been working with ASP .NET and data for a couple months now. I'm creating a web app that is more or less a "virtual worksheet" with multiple choice questions. I get the question text and four answers from an Access database. Using data from an invisible GridView, I create Labels and RadioButtonLists at runtime and add them inside a View in my MultiView.
For I As Integer = 0 To Me.gvQMultipleChoice.Rows.Count - 1<br />
Dim lbl As New Label<br />
lbl.ID = "lblQ" & I<br />
lbl.Text = I + 1 & ". " & Me.gvQMultipleChoice.Rows(I).Cells(0).Text<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, lbl)<br />
Dim rad As New RadioButtonList<br />
rad.ID = "rad" & I<br />
For I2 As Integer = 0 To 3<br />
rad.Items.Add(SwitchChar(I2) & ". " & Me.gvQMultipleChoice.Rows(I).Cells(I2 + 1).Text)<br />
Next<br />
rad.RepeatDirection = RepeatDirection.Horizontal<br />
Me.vw1.Controls.AddAt(Me.vw1.Controls.Count - 5, rad)<br />
Next
Basically, make a Label, get its question text, add it to the View. Same with the RadioButtonList. This works fine. My problem is later, when I am trying to find out which RadioButton is selected. Me.vw1.Controls doesn't contain any of these Labels or RadioButtonLists.
<br />
Dim myControls As ControlCollection = Me.vw1.Controls<br />
For I As Integer = 0 To myControls.Count - 1<br />
If myControls(I).ID <> Nothing Then<br />
If myControls(I).ID.StartsWith("rad") Then<br />
Dim rad As RadioButtonList = Me.vw1.Controls(I)<br />
ans &= rad.SelectedIndex<br />
Else<br />
'ignore<br />
End If<br />
End If<br />
Next
This should work fine, I'm confident it would. But again, the problem is that the dynamically created controls aren't in the list. Does anyone know why it would be like this.
By the way, the Labels and RadioButtonLists show up, and I can select a RadioButton. The second bit of code is executed on a Button.Click event.
Thanks!
Evan Stoner
Breeze Innovations
|
|
|
|
|
You should... try the ASP.NET forum. Pretty sure you need to add those controls yourself.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
What do you mean by add them myself?
Evan Stoner
Breeze Innovations
|
|
|
|
|
I mean that when you're working with the ASP.NET WebForm event model and you're creating controls on the fly, you need to create them on the fly even when you're handling events - they don't persist.
I'm also totally serious about this being the wrong forum. I might be feeding you a complete load of BS, due to not having bothered with WebForms in a good two years now...
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Well, I appreciate your help anyway.
Sorry, I guess I saw Web Dev first and just assumed. I'll try again in ASP.
Thanks.
Evan Stoner
Breeze Innovations
|
|
|
|
|
Hi,
In jsp and I guess in other "smart" html scripting languages there is a way to write "normal" html code inside script. For example, I can write something like:
<br />
<br />
<HTML><br />
<BODY><br />
#start_script<br />
if(some condition)<br />
{<br />
#stop_script<br />
<h1>Hello </h1><br />
#start_script<br />
}<br />
else<br />
{<br />
#stop_script<br />
<h3>World</h3><br />
#start_script<br />
}<br />
#stop_script<br />
</BODY><br />
</HTML><br />
<br />
This parts of the html are conditional and I don't have to use lot of document.write statements. Can I do this somehow with java script?
Thanks,
Yariv
|
|
|
|
|
Yariv wrote: Can I do this somehow with java script?
Do what? Not use document.write() ? By all means, please do not use it. It is eviiiil.
That said, no, there's no good way to use client-side JS the way you'd use a server-side template language. They're kinda meant for different things - what's wrong with leaving the bulk HTML generation to server-side JSP/PHP/etc.?
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Shog9 wrote: what's wrong with leaving the bulk HTML generation to server-side JSP/PHP/etc?
Hmmmm...because I don't have server.
I'm using html as UI for mfc as template. I generate an xml island in the html page, as database, and therefor want the html code to skip or display parts according to the xml data. Since I'm generating the html in my code it's not a big deal to use document.write all over the html, but since I don't know javascript well, I thought to ask if there is a client side solution to "conditional html".
Thanks for your help,
Yariv
|
|
|
|
|
Yariv wrote: I'm using html as UI for mfc as template.
Oh. So, what, you're embedding MSHTML in your desktop app?
That actually makes it a good deal easier - generating HTML in native code is much, much faster than using Javascript.
I recommend using XSLT to develop templates that will transform your XML into HTML, and then loading that.
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
Yariv wrote: In jsp and I guess in other "smart" html scripting languages there is a way to write "normal" html code inside script
Yariv wrote: and I don't have to use lot of document.write statements. Can I do this somehow with java script?
You can use inline HTML in Server side Javascript ( if you have a server that provides a Javascript engine) but document.write is part of the Object Model of the browser and is therefore Client Side.
led mike
|
|
|
|
|
I am doing an application in which i want to put some images and under them comes a text... On clicking the text it should go to the website....
Here is the sample code attached.....The innerhtml is given "GoTo Website" and on clicking that it should redirect to the website...and it use javascript...
Can anyone please help me do this........
Thanks in advance
SAJAN A PILLAI
ASP.NET,C#.NET Programmer
dWise Solutions and Services Pvt Ltd.
BANGALORE
"Winners don't do different things. They do things differently. ...
modified on Sunday, April 6, 2008 1:32 AM
|
|
|
|
|
sajan ss wrote: SAJAN A PILLAI
ASP.NET,C#.NET Programmer
dWise Solutions and Services Pvt Ltd.
BANGALORE
You want to know how to create an anchor tag ? Either you're not serious, or this represents a new low in Indian contract development.
Perhaps you need to explain better. You want to create the link using javascript, or you have a reason for wanting to use javascript to redirect ?
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 )
|
|
|
|
|
Christian Graus wrote: Either you're not serious, or this represents a new low in Indian contract development.
I think we're running out of low at this point but that is still hilarious
"Either you're not serious, or this represents a new low in Indian contract development."
Christian Graus - in the Web Development forum
|
|
|
|
|
led mike wrote: I think we're running out of low at this point
Checked the article submissions lately? How about the comments attached that praise them...!
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|
|
*sigh* I know....
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 )
|
|
|
|
|
sajan ss wrote: ASP.NET,C#.NET Programmer
sajan ss wrote: Here is the sample code attached.....
hmm still finding attachment
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
How to Fill Area of coords with different colors in Image. When mouseover on that Area.
Codes:
Please soon
Mohan Balal
--------------
(Sr.Software Engineer)
|
|
|
|
|
Hi all,
I am trying to learn how to layout my webpage using tables, so I decided to create a short simple webpage for the purpose. The page consists of the header which was created using a table with three columns, and the Main part of the page which was also created using a three column table. The Main part is right below the header. The second column of the Main part has a two column table inserted in it. The problem that I have is that when I view the page in FireFox, the table in the second column of the Main part gets pushed up into the second column of the header. However if I view the page in IE, the table in the second column of the Main Part is where I wanted it to be. Can someone please show me how to get the table to be in the same location no matter what browser I view the page in? Below is my HTML tags and thank you in advance for your time.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>
Welcome2
</title>
<style>
body {margin:0px 10px 0px 10px; padding:0px;}
a:link {color:#df7618;text-decoration:none}
a:active {color: Red}
a:visited {color:orange;font-family:arial, verdana, sans-serif; /* ADDED */}
a:hover {background:#7A5DC7;color:yellow;}
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="z-index: 100; left: 0px;
width: 1024px; position: absolute; top: 0px; height: 101px">
<tr>
<td style="width: 109px;background-color:purple"></td>
<td style="width: 806px; font-style:italic; font-size:56px;background-color:blue; color: orange; text-align:center;">Welcome</td>
<td style="width: 109px; background-color:purple"></td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" style="z-index: 101;left:0px;width:1024px;position: absolute; top: 101px; height: 140px">
<tr>
<td style="width: 109px; background-color:purple"> </td>
<td style="width: 806px; background-color:black">
<table border="1" cellpadding="0" cellspacing="0" style="z-index: 101;width:790px;left: 117px; font-size:16px; position:absolute;height:101px;top ">
<tr >
<td style="width: 147px;height:26px;color:white; text-align:center ">
<A href="Home.html">Home</A></td>
<td style="width: 147px;color:white; height:26px; text-align:center">
<A href="AboutUs.html">About Stuff</A></td>
</tr >
<tr>
<td style="width: 147px;color:white; height:34px; text-align:center ">
<A href="Subscribe.html">Trial</A></td>
<td style="width: 147px;color:white; height:33px; text-align:center ">
<A href="Current.html">Current Stuff</A></td>
</tr>
<tr>
<td style="width: 147px;color:white; height:34px; text-align:center ">
<A href="Locations.html">Pick Up Locations</A></td>
<td style="width: 147px;color:white; height:34px; text-align:center ">
<A href="stuf.html">Stuff</A></td>
</tr>
</table>
</td>
<td style="width: 109px; background-color:purple"> </td>
</tr>
</table>
</body>
</html>
<div class="ForumMod">modified on Saturday, April 5, 2008 3:43 AM</div>
|
|
|
|
|
I see the page rendered similarly in IE7 and FireFox 2. So, I am not able to figure out what difference you see.
----
In the new scheme of things, pages are supposed to be laid out using div tags.
http://www.w3.org/2002/03/csslayout-howto[^]
There are many other tutorials on the Internet.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
How to change the browser icon in address bar?
|
|
|
|
|
|
I want add a row to the table dynamically using JavaScript code. In one my application it works fine. But in this application it is prompting error to IE 'unknown runtime error.'.
I have use css style sheet in this project. I am not able to find the exact cause and solution of problem.
This is an classic asp. I request you all to please help me out to find the solution.
I am provide original code of the page:
-----------------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="dsp/include/includedb.asp"-->
<!--#include virtual="dsp/include/checkLogin.asp"-->
<%
dim rsItem, strSql, strItem
set rsItem = Server.CreateObject("ADODB.RecordSet")
strSql = "SELECT * FROM iteam_MSt WHERE status=true;"
rsItem.Open strSql, con, 1, 3
do until rsItem.EOF
strItem = strItem & "<option value='" & rsItem.Fields("iteam_ID") & "-" & rsItem.Fields("price") &"-" & rsItem.Fields("iteam_Code") &"'>" & rsItem.Fields("details") & "</option>" & vbCrLf
rsItem.MoveNext
loop
rsItem.Close
set rsItem = nothing
con.close
set con = nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>New Purchase</title>
<link href="../include/dsp.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var ct = 1;
function CmdAdd_onclick() {
var newTable,startTag,endTag;
newTable = "";
startTag = "";
endTag = "";
var trContents0, trContents1, trContents2, trContents3, trContents4, trContents5, trContents6;
ct = ct + 1;
//Creating a new table
startTag+= "<table width='100%' border='0' cellspacing='0' cellpadding='2'>"
startTag+="<tr>"
startTag+="<td width='2%'>No</td>"
startTag+="<td width='28%'>Product Name</td>"
startTag+="<td width='17%'>Product Code</td>"
startTag+="<td width='10%'>Price</td>"
startTag+="<td width='15%'>Quantity</td>"
startTag+="<td colspan='2'>Total Amount</td>"
startTag+="</tr>"
startTag+="<tr>"
startTag+="<td colspan='7'></td>"
startTag+="</tr>"
endTag = "<tr><td colspan='7'></td></tr>"
endTag +="<tr><td colspan='5'><div align='right'>Grand Total</div></td><td colspan='2'><input name='txtGrndTotal' type='text' id='txtGrndTotal' style='font-size:12px; border:0px;' value='' size='20' readonly='readonly' /></td></tr>"
endTag +="<tr><td colspan='7'></td></tr>"
endTag +="<tr><td colspan='7'><input type='submit' name='Submit' value='Create Final Bill' /></td></tr></table>"
newTable=startTag;
var opt;
//Get the row contents
trContents0=document.getElementsByName('txtno');
trContents1=document.getElementsByName('cmbProduct');
trContents2=document.getElementsByName('txtCode');
trContents3=document.getElementsByName('txtPrice');
trContents4=document.getElementsByName('txtQty');
trContents5=document.getElementsByName('txtTotAmnt');
//trContents6=document.getElementsByName('txtGrndTotal');
//opt=document.getElementById('LstProdNo');
if(trContents1.length > 0)
{
for(i=0;i<trContents1.length;i++)
{
if(trContents1(i).innerHTML)
{
// newTable+="<TR><TD style=\"WIDTH: 120px\" ><input name=\"txtno\" type=\"text\" readonly=\"readonly\" size=\"5\" value='" + trContents0(i).value + "'/>" +"</TD>";
// newTable+="<TD style=\"WIDTH: 120px\" ><select name=\"LstProdNo\" id=\"userid\">" + trContents1(i).innerHTML + "</select>" +"</TD>";
// newTable+="<TD style=\"WIDTH: 120px\" ><input name=\"TxtQty\" type=\"text\" id=\"username\" value='" + trContents2(i).value + "'/>" +"</TD>";
// newTable+="<TD style=\"WIDTH: 120px\" ><input name=\"TxtPrice\" type=\"text\" id=\"department\" value='" + trContents3(i).value + "'/>" +"</TD><TR>";
newTable+="<tr>"
newTable+="<td><input name=\"txtNo\" type=\"text\" id=\"txtNo\" style=\"font-size:12px; border:0px;\" size=\"4\" readonly=\"readonly\" value='" + trContents0(i).value + "'/></td>"
newTable+="<td><select name=\"cmbProduct\" id=\"cmbProduct\" style=\"font-size:12px;\">" + trContents1(i).innerHTML + "</select></td>"
newTable+="<td><input name=\"txtCode\" type=\"text\" id=\"txtCode\" style=\"font-size:12px; border:0px;\" readonly=\"readonly\" value='" + trContents2(i).value + "' /></td>"
newTable+="<td><input name=\"txtPrice\" type=\"text\" id=\"txtPrice\" style=\"font-size:12px; border:0px;\" size=\"5\" readonly=\"readonly\" value='" + trContents3(i).value + "' /></td>"
newTable+="<td><input name=\"txtQty\" type=\"text\" id=\"txtAmnt\" style=\"font-size:12px;\" size=\"5\" value='" + trContents4(i).value + "' /></td>"
newTable+="<td width=\"19%\"><input name=\"txtTotAmnt\" type=\"text\" id=\"txtTotAmnt\" style=\"font-size:12px; border:0px;\" size=\"10\" readonly=\"readonly\" value='" + trContents5(i).value + "'/></td>"
newTable+="<td width=\"9%\"> </td>"
newTable+="</tr>"
}
}
}
//Add the Latest row
/*newTable+="<TR><TD style=\"WIDTH: 120px\" ><input name=\"txtno\" type=\"text\" readonly=\"readonly\" size=\"5\" value='" + ct + "'/>" +"</TD>";
newTable+="<TD style=\"WIDTH: 120px\" ><select name=\"LstProdNo\" id=\"userid\">" + opt.innerHTML + "</select>" +"</TD>";
newTable+="<TD style=\"WIDTH: 120px\" ><input name=\"TxtQty\" type=\"text\" id=\"username\" value=\"0\" />" +"</TD>";
newTable+="<TD style=\"WIDTH: 120px\" ><input name=\"TxtPrice\" type=\"text\" id=\"department\" value=\"0\"/>" +"</TD><TR>";*/
newTable+="<tr>"
newTable+="<td><input name=\"txtNo\" type=\"text\" id=\"txtNo\" style=\"font-size:12px; border:0px;\" size=\"4\" readonly=\"readonly\" value='" + ct + "'></td>"
newTable+="<td><select name=\"cmbProduct\" id=\"cmbProduct\" style=\"font-size:12px;\">" + trContents1(0).innerHTML + "</select></td>"
newTable+="<td><input name=\"txtCode\" type=\"text\" id=\"txtCode\" style=\"font-size:12px; border:0px;\" readonly=\"readonly\" /></td>"
newTable+="<td><input name=\"txtPrice\" type=\"text\" id=\"txtPrice\" style=\"font-size:12px; border:0px;\" size=\"5\" readonly=\"readonly\" /></td>"
newTable+="<td><input name=\"txtQty\" type=\"text\" id=\"txtAmnt\" style=\"font-size:12px;\" size=\"5\" /></td>"
newTable+="<td width=\"19%\"><input name=\"txtTotAmnt\" type=\"text\" id=\"txtTotAmnt\" style=\"font-size:12px; border:0px;\" size=\"10\" readonly=\"readonly\" /></td>"
newTable+="<td width=\"9%\"><input type=\"button\" name=\"Button\" value=\"ADD Product\" onclick=\"CmdAdd_onclick();\"/></td>"
newTable+="</tr>"
newTable+=endTag;
//Update the Previous Table With New Table.
document.getElementById('mainTbl').insertAdjacentHTML;
document.getElementById('mainTbl').innerHTML=newTable;
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40" class="Head1">Buy Products</td>
</tr>
<tr>
<td class="smlTbLine1"></td>
</tr>
<tr>
<td><form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellpadding="2" cellspacing="0" id="mainTbl">
<tr>
<td width="2%" class="reportHead3">No</td>
<td width="28%" class="reportHead3">Product Name </td>
<td width="17%" class="reportHead3">Product Code </td>
<td width="10%" class="reportHead3">Price</td>
<td width="15%" class="reportHead3">Quantity</td>
<td colspan="2" class="reportHead3">Total Amount </td>
</tr>
<tr>
<td colspan="7" class="smlTbLine"></td>
</tr>
<tr>
<td><input name="txtNo" type="text" id="txtNo" style="font-size:12px; border:0px;" value="1" size="4" readonly="readonly"/></td>
<td><select name="cmbProduct" id="cmbProduct" style="font-size:12px;">
<%=strItem%>
</select> </td>
<td><input name="txtCode" type="text" id="txtCode" style="font-size:12px; border:0px;" readonly="readonly" /></td>
<td><input name="txtPrice" type="text" id="txtPrice" style="font-size:12px; border:0px;" value="1" size="5" readonly="readonly" /></td>
<td><input name="txtQty" type="text" id="txtQty" style="font-size:12px;" size="5" /></td>
<td width="19%"><input name="txtTotAmnt" type="text" id="txtTotAmnt" style="font-size:12px; border:0px;" size="10" readonly="readonly" /></td>
<td width="9%"><input type="button" name="Button" value="ADD Product" onclick="CmdAdd_onclick();"/></td>
</tr>
<tr>
<td colspan="7" class="smlTbLine"></td>
</tr>
<tr>
<td colspan="5" class="reportHead3"><div align="right">Grand Total </div></td>
<td colspan="2"><input name="txtGrndTotal" type="text" id="txtGrndTotal" style="font-size:12px; border:0px;" value="" size="20" readonly="readonly" /></td>
</tr>
<tr>
<td colspan="7" class="smlTbLine"></td>
</tr>
<tr>
<td colspan="7"><input type="submit" name="Submit" value="Create Final Bill" /></td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td class="smlTbLine1"></td>
</tr>
</table>
</body>
</html>
Kiran Sajanikar
Software Engineer
Pune.
|
|
|
|
|
Boil it down to the smallest possible amount of code necessary to reproduce the problem. The stuff you've posted has a fair bit of commented-out code, do-nothing code, and code that depends on your particular scenario (and so cannot be used to reproduce the problem by anyone here who might be interested in doing so.)
Citizen 20.1.01 'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'
|
|
|
|