|
I want to use Ajax in External .js File...
I have some code in PHP which is similar to following...
function Validate()
{
var pars="selectedIndex="+strUname+"&objname=checkPid";
var url ='/checkUser.php';
var sucReqUname=function(t){
document.getElementById("chackingmsg").innerHTML="";
avail_uname=t;
if(t == "1"){ val_failed();
return false;
}
else{ val_success(o.id);}
}
getAjaxRes(url,pars,sucReqUname);
}
//common ajax
function getAjaxRes(url,params,ResRetFun){
var http = new GetXmlHttpObject();
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200)
ResRetFun(http.responseText);
}
http.send(params);
}
function GetXmlHttpObject(){
var xmlHttp=null;
try{ xmlHttp=new XMLHttpRequest();}
catch (e){// Internet Explorer
try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
catch (e){ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
}
return xmlHttp;
}
i want to use this code in java script .. can any one tell me how to use
this in asp.net in external .js file...
its urgent........
Thanks in advance....
modified on Wednesday, November 11, 2009 4:21 AM
|
|
|
|
|
Hi,
We have developed an (ASP.NET) Web Application in VS 2008 & developed a setup project for the same and successfully installed in our local environment (Windows XP/ Windows 2003 server).
This web setup project contains the below:
1. Web Application (Primary output/ Content)
2. Primary output of BLL & DAL
3. Few custom actions
4. Few UI Forms to get the Database details/ etc from user
5. One Windows service
This setup fails immediatley in the client environment. The client also using the Windows XP SP2/ 32 bit version. But the windows root folder is "C:\WINNT"; bcos the system has been upgraded from Windows 2000 to XP it seems.
After that we have removed the custom actions and Windows service from the setup project (to narrow down the issue) & tried to install, it also failed.
We dont have any clue on this. Can you please help...
Thanks in Advance !!
Jey
|
|
|
|
|
hi sir
i want separate two columns of crystal report by colon( .and i want 3 records of two column in half vertical portion of the page and next 3 records display on remaining part of same page with colon.
and i mean i want something like this please help me
Sno rollno student name Sno rollno student name
1. 001:A 4. 004
2. 002:B 5. 005:E
3. 003:C 6. 006:F
|
|
|
|
|
hi
i m using radiobuttonlist with images like this
<asp:RadioButtonList ID="rbtnthumb1" runat="server">
<asp:ListItem Value ="News_icon.jpg"> <img src="images/News_icon.jpg" alt="News" align="absmiddle"> News</asp:ListItem>
<asp:ListItem Value ="imageicon.bmp"><img src="images/imageicon.bmp" alt="Image" align="absmiddle">Image</asp:ListItem>
<asp:ListItem Value ="Video97.gif" ><img src="images/Video97.gif" alt="Video" align="absmiddle">Video</asp:ListItem>
</asp:RadioButtonList>
In design view it show radiobuttonlist with images but when i use insert query.it stored this value in mytable
<img src="images/News_icon.jpg" alt="News" align="absmiddle"> News
but i only want to store News_icon.jpg(image file name)and i m using this way for adding value
cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedItem.Text)
please let me know how to stroe only imagefile name in database table
regard's
|
|
|
|
|
What have you tried ? How much do you know about the languages you're using ? What do you think the solution might be ?
Seems to me like the most likey solution is to use some string mashing to extract the value, or a regex.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
thanks for reply
i m beginner and trying to save a imgefilename in database with radiobuttonlist.i do't know may be my approach wrong or right
can you tell me right concept about my question ? if i m doing wrong then what is the right way
mustafa
|
|
|
|
|
creative77 wrote: i m beginner
Then this task is way too complex for you. You should abandon it, and spend some time learning basic exercises instead. Except you're being paid for this code, right ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Use this :
cmd.Parameters.AddWithValue("@ChooseThumbnail", rbtnthumb1.SelectedValue)
If you call
SelectedItem.Text
it will return the innerhtml under the listitem.
On the other hand if you call SelectedValue , it will return the value attribute assigned in asp:ListItem .
Hope you like it.
Another thing it is better to write like
<img src="images/Video97.gif" alt="Video" align="absmiddle" />
You havnt closed any img tag using /> on the right.
|
|
|
|
|
How to get live stream from webcam in our web page?
|
|
|
|
|
You can't do that with ASP.NET. You can do it with HTML. What have you tried ? Did you search the web for info at all ? Where is the webcam, on the server ? You can create a stream and set up windows media player to display it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
AFAIK, live stream can only be captured using some windows client...
or any plugin which allows direct access to webcam devices.
I dont know if Flash / Adobe AIR / Silverlight plugins allows you to capture live streams from browser. If they cant, you need to create your own browser plugin.
|
|
|
|
|
This was my code to display live streaming from webcam.
hope thi will work for u.
u need to install the webcam and than place this file in ur initpub folder
to share the images on web and allow the user to view it.
u also need to install latest version of media player and windows media encoder.
<object id="MediaPlayer" width="176" height="144" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<param name="autoStart" value="True" />
<param name="filename" value="http://localhost:8080" />
<param name="ShowControls" value="False" />
<param name="ShowStatusBar" value="true" />
<embed type="application/x-mplayer2" src="http://localhost:8080" name="MediaPlayer" width="176" height="144" autostart="1" showcontrols="0" />
<object id="Player" width="300" height="250"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="URL" value="http://localhost:8080" />
<param name="uiMode" value="none" />
You can also view this live feed directly in Windows Media Player by clicking here.
and do not forget to rank the reply if u get thi working....
all the best
|
|
|
|
|
Ive an Obout calender that i change its datemin , datemax according to Dropdownlist selected item, i want the textbox (that the calender copy its value to ) to be clear(empty) when the DDL changes for the user to select a new date ,DDl is AutoPostback true ,ive tried this in the [ddlVacationTypes_SelectedIndexChanged]:
TextBox1.Text = "" 'Didnt work the textbox is holding the last value
i also tried this in the [Page_Load]:
Page.RegisterClientScriptBlock("MyScript", _
"<script language=javascript>" & _
" document.getElementByID('TextBox1').value = '' ; </script>")
'Didnt work the textbox is holding the last value
what am i doing wrong? + How to fix this?
thXs
|
|
|
|
|
You might be setting it up on page_load :S
Please don't forget to mark 'Good Answer', if you find it really a good one!
Kashif
|
|
|
|
|
Have you stepped through the debugger ? If you're using a third party control, perhaps it is what sets the value ?
alaminfad wrote: " document.getElementByID('TextBox1').value = '' ; ")
That won't work. Perhaps if you used the right client side ID, it might.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
And also before you run a script check if the script block is already exists in the page.Do like this :
if(!this.ClientScript.IsClientScriptBlockRegistered("MyScript"))
{
Page.RegisterClientScriptBlock("MyScript","<script language=javascript>" & _
" document.getElementByID('" + TextBox1.ClientId +"').value = '' ; </script>")
}
Also make sure you are not doing this every time the page is posted back. Always check :
if(this.IsPostBack)
{
}
inside Page_Load
Finally, if you make TextBox as serverside, you can set the value inside ddlVacationTypes_SelectedIndexChanged by just calling
TextBox1.Text = ddlVacationTypes.SelectedValue
It must work.
|
|
|
|
|
Unfortunately it did'nt work ,i do want this every time the page is posted back , i mean when the user select from the DDL the textbox1 should be empty for him(user) to notice and select a date from the Obout calender image , i tried it both ways(if and if not is post back) it didnt work , i found this property Clear() on the Obout tutorials :
**************************************************
If you need to clear the current selected date simply call the method Clear.
Example:
<obout:Calendar runat="server" id="myCal">
</obout:Calendar>
<a onclick="myCal.Clear();">
Clear
</a>
***********************************************
by the way ive two page loads
one page_load in the user control where the DDl and obout Calender and of course its Textbox which we want to clear
Second page_load in the actual default page
so ive tried to use that property in both page_loads it didnt work ,i have follwed the debugger it going in the right way , here is the code
-----------------------------
Dim script As New StringBuilder
' Dim reader As StreamReader = File.OpenText(Server.MapPath(includeFilePath))
If Not Page.ClientScript.IsClientScriptBlockRegistered("MySript") Then
'script.Append(reader.ReadToEnd.Replace("{title}", Me.Title).Replace("{buttonLabel}", Me.ButtonLabel))
' delay alert 1 ms to handle postback
script.Append("<script language='javascript'>document.dfghsdfggetElementByID('Calendar1').Clear();</script>")
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "MySript", script.ToString)
End If
--------------------------------------------------------------------
one more thing the server doesnt seem to validate what inside the script even if write
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "MySript","Nothing")
what is a problem? + how to fix it?
|
|
|
|
|
<b></b>Hi!!
While opening a solution in VS.net 2003, i am getting an error:
"HTTP redirect request failed."
Please help.
modified on Wednesday, November 11, 2009 12:51 AM
|
|
|
|
|
Member 4959176 wrote: "HTTP redirect request failed."
have you googled this error..... post the code where you are getting this error...
|
|
|
|
|
yes I tried this in google but didnt get any correct solution.
The error is coming while opening the solution in VS.NET.
|
|
|
|
|
WEird. I googled it and found heaps[^] of help.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
but none of the solution is working for my application.
|
|
|
|
|
Well, if you want help, be clear. If you don't tell us what you tried, don't you think people here will just suggest the same things ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Member 4959176 wrote: < b >< /b >Hi!!
RPH - Reverse Polish HTML...
|
|
|
|
|
Hi All,
Can i Use Singleton design pattern in Web application like when i m calling Bll from the User inteface.
Thanks and regards,
Amit Patel
|
|
|
|