|
Hi guys really i got tired in this...,
i am using create xmlhttp concept in my project...,
its working fine in ie...,but not in mozilla...,
in mozilla if i give the alert statement for my request object...,
its working fine...,if i remove the alert its not working...,
really not getting whats the probs...,
function CreateXmlHttp1()
{
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
{
if(window.ActiveXObject)
{
try
{
senNif = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
senNif = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(oc)
{
senNif = null;
}
}
}
}
else
{
if (window.XMLHttpRequest)
{
senNif = new XMLHttpRequest();
}
}
}
function SetNewDiscussion(txtcomment,txtname,txtemail)
{
var tf=checkTextArea(txtcomment, "2000");
if(tf == false)
{
alert("Please Enter only 2000 characters");
return false;
}
if(txtcomment=="")
{
alert("Enter Your Comment");
document.getElementById("txtDiscComment").focus();
return false;
}
else if(txtname=="")
{
alert("Enter Your Name");
document.getElementById("txtDiscName").focus();
return false;
}
else
{
var bloghidsrno=document.getElementById("<%=hidblogsrno.ClientID %>").value;
var tdDiscnewresult=document.getElementById('tdDiscnewresult');
var Url;
Url="BlogsDiscussionInsert.aspx";
var params = "blogsrno="+bloghidsrno+"&txtcomment="+txtcomment+"&txtname="+txtname+"&txtemail="+txtemail+"×tamp="+new Date().getTime();
CreateXmlHttp1();
var type="RP";
if(senNif)
{
senNif.open("POST", Url, true);
senNif.onreadystatechange = function(){getDataResponseNew(tdDiscnewresult);};
senNif.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
senNif.setRequestHeader("Content-length", params.length);
senNif.setRequestHeader("Connection", "close");
senNif.send(params);
}
}
window.location.reload();
}
function getDataResponseNew(id)
{
//alert(senNif.readyState);
if(senNif.readyState == 0)
{
id.innerHTML="UNINITIALIZED";
}
else if(senNif.readyState == 1)
{
id.innerHTML="LOADING";
}
else if(senNif.readyState == 2)
{
id.innerHTML="LOADED";
}
else if(senNif.readyState == 3)
{
id.innerHTML="INTERACTIVE";
}
else if(senNif.readyState == 4 && senNif.status == 200)
{
id.innerHTML=senNif.responseText;
}
}
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Dude! I don't find anything wrong but u were reloading your page imdtly sending request. can u comment it and have a try
//window.location.reload();
|
|
|
|
|
Hi All,
I have developed a site(IN Classic ASP) for news channel and i want to implement/Show Live vedio on site . Its just like a chennal on web where user can see pre recorded video. How can i implement this functionality in classic ASP site?
My site in classic ASP 3.0 and MS sql server 2005. My hosted server is not streaming server. please help ...
Thanks in Advance
Life is not easy ,let's make it.
|
|
|
|
|
asprajesh wrote: My site in classic ASP 3.0 and MS sql server 20
So, What are doing in ASP.Net forum?
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Thanks for your suggestion.
Life is not easy ,let's make it.
|
|
|
|
|
May posting this question to web development forum helps you !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi..
all i m showing three columns in gridview from database.the columns names are
DemandFor,Demand,demandPostedOn.In the last column i have given a button name "Feedback".
On click of this button i want to redirect on "Feedback.aspx" page.I n this page i want to show the fields DemandFor and Demand in the textboxes.I have redirected the page on button click.
but i dont know how to get the values of that particular row in which the button was clicked.
can any body guide me or give me a sample code.thanks...
|
|
|
|
|
|
nagendrathecoder wrote: http://www.codeproject.com/KB/webforms/GridView_DropDownList.aspx
sry its working fine
plz check the above link once..
If It Helps Click It as Answer
|
|
|
|
|
|
When you are click on the button, on the RowCommand Event, use GridViewRow Class to hold the data for tat row. the pass it to next page either using session or query string.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hiii...
i got it sir.thanks sir....
Regards
parikshit
|
|
|
|
|
welcome sir
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi,
I have a page which refresh every 3 - 5 seconds, i gave refresh in meta tag. While refreshing, as normal all the controls are dissapear and display a white page for some milliseconds. I need to block the controls from disappearing at the time of refresh. ie, the user should not understood that page is refreshing.
How can i do that
Thankyou
Ypki
|
|
|
|
|
What is use of refresh the whole page ? Do you want to update any particular section or value on your page ? Then why you are not looking into AJAX Update Panel and AJAX Timer control to refresh the particular section, rather than Refreshing whole page.
Thank You !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
The whole page contain a dynamically created html table with number of cell, in each there will be a value, these values will change frequently. Thats why i am refreshing the whole page.The page contain only that html table.
In AJAX Update Panel also the controls will dissapear for some milli seconds..ryt??
|
|
|
|
|
Use AJAX based solution.
Say you load the page within a div.
During refresh, make an AJAX request which will get the latest data and show in the div.
To know how to do an AJAX request follow :
http://www.w3schools.com/Ajax/Default.Asp[^] tutorial.
|
|
|
|
|
Hi,
I am installed Visual studio 2008 team player in my system.I have to run MS Petshop web application on my system but whenever I am opening my project from VS 2008 and executing it,I am encountering an exception.If I installed petshop's just source code,it throws exception as system.typeinitialization exception. and if I am installing petshop completely ,it throws system.reflection.targetinvocation exception.Please help me solve this error.
Thanks!
|
|
|
|
|
If I'm having a form with n textboxs (n defined by te user by pressing a "new registry" button for example), and the textboxs are named product1, product2, ...productn..
How should I retrieve the data in the POST?
Should I send n thrue the form too?
What is the typical way of doing this kind of forms??.. that there is a main record in a db (for example some headers) and n records within that record? is there a good practice way?
The db would look like
table1: mainid, headers
table2: id, mainid, etc.
(ie. one to many relationship)
|
|
|
|
|
Quake2Player wrote: If I'm having a form with n textboxs (n defined by te user by pressing a "new registry" button for example), and the textboxs are named product1, product2, ...productn..
I guess you are creating dynamic textbox on Button Click.
The control which you are creating dynamically, you need to created before Page_Load() , other wise, it will not able to maintain the View State Data or will not load the Postback Data.
If you deeply look inside ASP.NET Page Life Cycle, Before Page_Load(), there are two different methods calls. 1) LoadViewState() and 2)LoadPostbackData() .
So, if you create any control on Page_Load() , or after that it will not able to load the data.
So you need to create such control either in Pre_Init() or Init() method.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
That also applies for ASP.NET MVC? Which isnt that event oriented as pure ASP.net?
Anyway, is it ok the way im describing? To retrieve "n" and based on that retrieve the inputs.. or is there something like a container where i can do like "for each control in container" ?
|
|
|
|
|
my project is running locally fine. But when i upload it shows below error
[ArgumentNullException: Value cannot be null.
Parameter name: type]
System.Activator.CreateInstance(Type type, Boolean nonPublic) +7465206
System.Web.Profile.ProfileBase.CreateMyInstance(String username, Boolean isAuthenticated) +79
System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated) +231
System.Web.HttpContext.get_Profile() +107
ProductsAccordingCat.get_Profile() +49
ProductsAccordingCat.gotoCart(Object sender, EventArgs e) in ProductsAccordingCat.aspx.cs:696
System.Web.UI.ImageClickEventHandler.Invoke(Object sender, ImageClickEventArgs e) +0
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
Please help me to solve this problem.
below is code
protected void gotoCart(object sender, EventArgs e)
{
ImageButton btn = (ImageButton)sender;
double Price = double.Parse(((Label)btn.Parent.FindControl("Price")).Text);//.Substring(8));
string ProductName = ((HyperLink)btn.Parent.FindControl("hlnkProductName")).Text;
string ImagePath = ((System.Web.UI.WebControls.Image)btn.Parent.FindControl("imgProduct")).ImageUrl;
string ProductID1 = ((HtmlInputHidden)btn.Parent.FindControl("hdnid")).Value;
string ParentID = ((HtmlInputHidden)btn.Parent.FindControl("hdnParentID")).Value;
int ProductID = Convert.ToInt32(ProductID1.Substring(1));
if (Profile.Cart == null) // here at this line it shows error
{
Profile.Cart = new shopping.ShoppingCart();
}
Profile.Cart.Insert(ProductID, Price,0, 1, ProductName, ImagePath);
Response.Redirect(ResolveUrl("~") + "Shopping_Cart/ShoppingCart.aspx");
}
modified on Tuesday, September 22, 2009 12:52 PM
|
|
|
|
|
Can you show us the code where it is breaking down? The stack helps, but not that much.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
below is code
protected void gotoCart(object sender, EventArgs e)
{
ImageButton btn = (ImageButton)sender;
double Price = double.Parse(((Label)btn.Parent.FindControl("Price")).Text);//.Substring(8));
string ProductName = ((HyperLink)btn.Parent.FindControl("hlnkProductName")).Text;
string ImagePath = ((System.Web.UI.WebControls.Image)btn.Parent.FindControl("imgProduct")).ImageUrl;
string ProductID1 = ((HtmlInputHidden)btn.Parent.FindControl("hdnid")).Value;
string ParentID = ((HtmlInputHidden)btn.Parent.FindControl("hdnParentID")).Value;
int ProductID = Convert.ToInt32(ProductID1.Substring(1));
if (Profile.Cart == null) // here at this line it shows error
{
Profile.Cart = new shopping.ShoppingCart();
}
Profile.Cart.Insert(ProductID, Price,0, 1, ProductName, ImagePath);
Response.Redirect(ResolveUrl("~") + "Shopping_Cart/ShoppingCart.aspx");
}
|
|
|
|
|
I would be interested to know if you ever found a solution. I too have recently come across this very same issue when trying to access the Profile object. I dont think it is related to this article some configuration issue on the server - look up MOSS and profile null.
|
|
|
|