Hai all,
Is any body know ajax?
40 2920
Post your problem code. What's supposed to happen and what's happening instead? What errors do you get, if any?
Hai all,
Is any body know ajax?
Let me know first how much u know AJAX?
Kind regards,
Dmjpro.
Hai all,
Thanks for replay. I want to create a popup window when i select ' add new' in dropdown list.iam using the following code. - url = "var W=window.open('" + url + "','Country','width=350,height=200,toolbar=no,menubar=no, scrollbars=no status=yes'); W.moveTo(110,30); W.focus(); "
-
-
Response.Write("<script> " + url.ToString + "</script>")
-
Before that for binding dropdown list details im using AJAX code.Now the problem here is Popup window is not opening?
Threads merged. Please do not double post.
Also remember to use code tags when posting code.
Hi all,
Any Answer to my problem.
Thanks,
Aswath.
Hai all,
Thanks for replay. I want to create a popup window when i select ' add new' in dropdown list.iam using the following code. - url = "var W=window.open('" + url + "','Country','width=350,height=200,toolbar=no,menubar=no, scrollbars=no status=yes'); W.moveTo(110,30); W.focus(); "
-
-
Response.Write("<script> " + url.ToString + "</script>")
-
Before that for binding dropdown list details im using AJAX code.Now the problem here is Popup window is not opening?
What is Response.Write.
Please Exaplin.
Kind regards,
Dmjpro.
Before that for binding dropdown list details im using AJAX code.Now the problem here is Popup window is not opening?
This code will not work because it is called while the page is loading.
Put it inside a function and then call that function onchange. Check that the selected value is "add new".
What is Response.Write.
I'm assuming Response.Write is ASP which is why I used ASP code tags.
Hi,
Response.write() means it will open new popup window. If i don't use ajax
to bind dropdown list details then popup window is opened for the same code what i listed above. But if i use AJAX window is not opening why?
Thanks,
Aswath.
Response.write() means it will open new popup window. If i don't use ajax to bind dropdown list details then popup window is opened for the same code what i listed above. But if i use AJAX window is not opening why?
Post the rest of your code.
Hi,
This is the entire code what iam using to create popup window. - url="country.aspx"
-
If a = "Add New" Then
-
url = "var W=window.open('" + url + "','Country','width=350,height=200,toolbar=no,menubar=no, scrollbars=no status=yes'); W.moveTo(110,30); W.focus(); "
-
Response.Write("<script> " + url.ToString + "</script>")
-
-
End If
-
Same code works for without AJAX. If i use AJAX This code is not working .Why?
Thanks,
Aswath.
Show your Ajax code and how you call it using the dropdown.
PS. use code tags when posting code.
Hi,
I will explain what my intension is, In my aspx page i have 3 dropdown lists country, state, city.If i select one country then related states will bind on state dropdown list. same for city also.
Without AJAX ::
I put country & state dpd's autopostback=true And to create popup window im using the above code.Then it successfully creating window.
With AJAX ::
I used ajax code to bind state & city details .So i got o/p without loading the page.But for creating popup window also im using the same code what i used above.But it is not working.
See post #8 in this thread. You will need to put it in a function and call that onchange (on the select element).
Hi,
Thanks,
I did what You told yestraday.I put my code in seperate function.Now The popup window is opening.But now i am getting other problem that i want to close that child window, for that iam using " Child.window.close()" method. but it is not closing.And I didn't get the details in dropdown list of my parent window.Why?
Thanks,
Aswath.
I did what You told yestraday.I put my code in seperate function.Now The popup window is opening.But now i am getting other problem that i want to close that child window, for that iam using " Child.window.close()" method. but it is not closing.And I didn't get the details in dropdown list of my parent window.Why?
Show your updated code.
You need to keep a reference to the opened window by, e.g. - var child = window.open(...);
Hi,
Thanks a lot, Now window is closing by creating reference.But i can't get the data of child window into my parent window.My parent window dropdownlist becomes empty.Any ideas....?
Thanks,
Aswath.
Show the code which populates the list.
Hi,
Code:.net
After Addibg One country im populating state details . - Dim sql1 As String = "select name as cstate,sid as id from master_state where cid = '" & cid & "' order by name for xml auto"
-
com = New SqlCommand(sql1, con)
-
dr = com.ExecuteReader()
-
If dr.HasRows Then
-
If dr.Read Then
-
s.Append(dr.GetString(0).Trim())
-
End If
-
Response.ContentType = "Text/xml"
-
-
Response.Write("<States>" + s.ToString())
-
In This time no states in newly added country so it display empty in state dropdown list, but in country dropdown list also it showing empty.Why?
Thanks,
Aswath.
Hi All,
Any Answer to my problem?
thanks,
Aswath.
In This time no states in newly added country so it display empty in state dropdown list, but in country dropdown list also it showing empty.Why?
Show the Javascript code that updates the state dropdown list.
Also remember to use code tags when posting code.
Dear Acoder,
I againg coming with new query, first of all thanks a lot u helped me more.All of my previous problems are rectified.After selecting "Add New" in dropdown list
The popup window is opening, But The problem is after the popup window is closing(autometically) the parent window is reloading to get the newly added details(country).But what my client needed is that the newly added value shuld be disply in that dropdownlist(country)
so plz help me.
Hi All,
Any Answer to my query....?
Thanks,
Aswath.
Hi,
Once the popup window is closed the parent window is reloading autometically in ajax why..?
Thanks,
Again, you'll have to show the code. Post your Javascript code (not .NET code). If there's a lot of code and it's possible, post a link to a test page instead.
Hi,
Iam Sorry,Still im not upload my project.and the AJAX code contains more than 600 lines,for all ie., creating popup window's for new country, new state, and new city.as well as binding state & city details after country dpd list has changed. So The problem is Once i create new country or state or city the parent window is reloaded and i lost the details on my parent window ie.,(company name, address etc...all textboxes).I need to enter the details once again in textboxes.
Thanks,
Aswath.
Locate the code which creates the country, state and city dropdown lists and just post that here.
Hi Acoder,
Here is code to create new country.
Code:(AJAX) ---- For New Country ------ - if(cid=="Add New")
-
{
-
if (obj!=null )
-
{
-
obj.onreadystatechange = n;
-
var url="Country.aspx";
-
var W=window.open(url,'Country','width=400,height=200,toolbar=no,menubar=no, resizable=yes,scrollbars=yes status=yes');
-
W.focus();
-
}
-
}
-
function n()
-
{
-
var c_id=document.getelementbyid("id");
-
if (obj!=null )
-
{
-
obj.onreadystatechange = contry;
-
obj.open("GET","../getcontact.aspx?id="+c_id+"&status=4",true);
-
-
obj.send(null);
-
}
-
}
-
-
function contry()
-
{
-
if(obj.readyState == 4)
-
{
-
if (obj.status == 200)
-
{
-
retval = ""
-
var retval = obj.responseText;
-
retval += "</countries>"
-
clearSelect(document.getElementById("dpdcontry"));
-
populatecntry(retval)
-
}
-
else
-
{
-
alert('error');
-
}
-
}
-
}
And remaning code is comman that is getting 'httprequestobject' .
Thanks,
Aswath.
Hai,
What's Happened.......?Can u understand my code.I thin no. Ok tell me how to store the page contents tempororly? I made all my controls to "EnableViewState=True" Then also i m not able to persist the details.
Thanks,
Aswath.
Hi Acoder,
I got the error ,but i don't know solution.The problem is here -
Response.Write("<Script language='JavaScript' type='text/javascript'>opener.location='Company.aspx?id=" + c_id + "';self.close(); </Script>")
Here im sending newly created Country_id to company.aspx page(parent).That's why parent window is reloading to get newly created country.Now tell me is there any way to reload only dropdownlist?
I tryed like
" dpdcontry.opener.location.reload(). " But it doesn,t works. U r my only hope
Thanks,
Aswath.
Hi Acoder,
Here is code to create new country.
On line 13, it should be document.getElementById().
Show the code for clearSelect and populateCntry functions.
Hi Acoder,
I got the error ,but i don't know solution.The problem is here -
Response.Write("<Script language='JavaScript' type='text/javascript'>opener.location='Company.aspx?id=" + c_id + "';self.close(); </Script>")
Here im sending newly created Country_id to company.aspx page(parent).That's why parent window is reloading to get newly created country.Now tell me is there any way to reload only dropdownlist?
I tryed like
" dpdcontry.opener.location.reload(). " But it doesn,t works. U r my only hope
To update the dropdown list, access the element using opener.document.getElementById(). Don't use location or reload(). That would just reload the page.
Hi
Here is the code for populate contry & clearselect
Code:(AJAX) - function populatecntry(response)
-
{
-
// var con_id=document.getElementById ("dpdcontry").value
-
var xmlDoc=new ActiveXObject("Microsoft.XMLDOM")//Create the XMLDOM object
-
xmlDoc.async = false
-
xmlDoc.loadXML(response)
-
var opt
-
var cityselem = xmlDoc.getElementsByTagName("countries")
-
var cityelem = cityselem[0].getElementsByTagName("master_country")
-
var opt = document.createElement("option")
-
opt.setAttribute("value",-1)
-
//var textnode = document.createTextNode ("Select Country")
-
opt.appendChild(textnode)
-
document.getElementById ("dpdcontry").appendChild(opt)
-
for (var i = 0;i<cityelem.length ;i++)
-
{
-
var textnode = document.createTextNode (cityelem[i].getAttribute("name"))
-
//alert(stateelem[i].getAttribute("cstate"))
-
appendtoselectcntry( document.getElementById ("dpdcontry"),cityelem[i].getAttribute("cid"),textnode)
-
}
-
}
-
-
-
-
function clearSelect(select)
-
{
-
//alert(document.getElementById ("dpdcontry"));
-
//alert(select);
-
select.options.length = 0;
-
}
-
I listed in previous post that in javascript is there nay way to reload only dropdownlis?
Thanks,
Aswath.
I listed in previous post that in javascript is there nay way to reload only dropdownlis?
You don't need to reload anything. Just access the element from the child window: - var dropdown = opener.document.getElementById("dpdcontry");
Then reset it by setting options.length to 0. Then update the list by adding options using the response (XML). Remember that you can add an option using syntax like: - dropdown.options[i] = new Option('text','value');
Hi Acoder,
I tried with your code, Here im getting dropdown value as "Add New"
I am not getting newly added country value.
Code:<Javascript>
var dropdown =opener.document.getElementById("dpdcontry");
I am closing popup window in CodeBehind of child page, and im retriving new value in html of parent page.that's why im getting "add new" only.If i pass new value in child window to parent window then i can get value but the entire window is reloading.I tried like
code:<JS>
Opener.location.reload(false)=company.aspx"+c_id"
it is showing error.Is there any other way?
Thanks,
Aswath.
Hi Acoder,
Any Answer to my problem........?
Thanks,
Aswath.
Why do you need the "Add New" option to open a popup window? Can you not just make the Ajax call in the parent window?
Hi Acoder,
How is it possible?After selecting "add new" in dropdown list then in ajax one property is there "Onreadystatechange".Im using this property to create popup windw.I know only this way. Is there any other way..?
Thanks,
Aswath.
Hi Acoder,
Thank you, from 4 days u r with me and resolved my doubts.The last problem i given to my Team Lead.Now im doing seperate work.If i will get any errors again i will discuss with u.Ok Thanks a lot.
Bye
Aswath.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Tony G. |
last post by:
Hi there,
I have an APS 3 application, running on a Windows 2003 Web edition server -
it is a very busy website, and when users are click on certain links
(membership info), a new window i...
|
by: melanieab |
last post by:
Hi,
I can't begin to understand this one. I have a form with a tabcontrol.
When I first enter one of the pages (whether by tabbing or opening the form),
I say to focus on a button. It does focus...
|
by: ravitunk |
last post by:
can anyone tell me how to open a popup window(.aspx page) on Mouse Rollover...everytime cursor is moved to a row of a gridview..this should also send a parameter to the popup window....where the...
|
by: =?Utf-8?B?bWF2cmljazEwMQ==?= |
last post by:
Hi,
I have a page which has some custom controls. The page works fine and
doesn't break on any number of refreshes.
There is button on the page, that starts a new child window. After doing any...
|
by: siva07 |
last post by:
<SCRIPT language=JavaScript type=text/javascript>
<!--
function open1(URL) {
popupWin = window.open(URL, 'popup', 'dependent=0,...
|
by: SangeethaAyyappan |
last post by:
Hi,
I have an application which requires a help window to pop-up, whenever the user clicks the 'Lookup' button. Everything works fine, except that the pop-up window displays for the first two...
|
by: rizwan6feb |
last post by:
Hi experts! I getting the following error message from Firefox, for the given code
Error: uncaught exception: Permission denied to get property Window.resizeTo
<!DOCTYPE html PUBLIC...
|
by: rkyakkala |
last post by:
Hi,
i am creating a popupwindow example.After entering the details i want to close the parent window(details.html)as it is moving to new window.could anybody suggest how can i do both task at a time...
|
by: Alon Stadler |
last post by:
Hi,
I'm trying to luanch a new window with Java Script - It works fine in Chrome and Firefox, but not with IE (I'm using IE8) or Avant browser.
The page is at...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |