|
AJAX or ScriptCallback
only two letters away from being an asset
|
|
|
|
|
Can you give some more details or some links ?
Thanks in advance !!!!
|
|
|
|
|
hi,
Why whole ASP.net page refresh on after clicking on website 's buttons ?What is the solution of this problem?
|
|
|
|
|
zeeShan anSari wrote: Why whole ASP.net page refresh on after clicking on website 's buttons?
It has nothing to do with ASP.NET, that's the way the web works . Maybe you should do some research about this "problem".
only two letters away from being an asset
|
|
|
|
|
zeeShan anSari wrote: Why whole ASP.net page refresh on after clicking on website 's buttons ?
That is how Web Applications work. A typical Request and Response model.
zeeShan anSari wrote: What is the solution of this problem?
XmlHttp or AJAX to refresh only a section of the page.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
zeeShan anSari wrote: Why whole ASP.net page refresh on after clicking on website 's buttons ?
It doesn't. You navigate to a new page, but you get the same effect as refreshing as you are navigating to a page with the same address.
zeeShan anSari wrote: What is the solution of this problem?
There is no solution, as there is no problem.
Experience is the sum of all the mistakes you have done.
|
|
|
|
|
Hi!
I am using thread to send multiple/bulk email. But my thread is not calling the me method that send emails.
I work well on localhost. But when i upload it on server it didn't call the method (sendNewsletter_1).
I am using following code
public static bool sendBulkEmail_1(int newsletterID)
{
m_newsletterID = newsletterID;
Thread threadMail = new Thread(new ThreadStart(sendNewsletter_1));
threadMail.IsBackground = true;
threadMail.Start();
Thread.Sleep(2000);
return true;
}
public static void sendNewsletter_1()
{
Log_1("SendNewsLetter"); //just write this test string to a file. Its just or testing.
}
|
|
|
|
|
Hi,
I have created a five star rating control. I have used ASP.Net 2.0 Clent Callbacks to implement the same. Following is my code
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RatingControl.ascx.cs" Inherits="RatingControl" %>
<%@ Implements Interface="System.Web.UI.ICallbackEventHandler"%>
<script language="javascript" type="text/javascript">
var totChecked = "<%=totChecked%>";
function callSwapImage(strVal)
{
var countRec;
var imgName;
for (countRec = 1; countRec<=parseInt(strVal); countRec++)
{
imgName = "imgStar" + String(countRec);
document.images[imgName].src = "images/starGold.gif";
}
}
function callSwapRedo()
{
var message = "0";
var context = "";
CallServer(message, context);
}
function onImgClick(strVal)
{
var countRec;
var imgName;
var message = strVal;
var context = "";
CallServer(message, context);
}
function ShowSuccess(sMessage, Context)
{
for (countRec = 1; countRec<=parseInt(sMessage) + 1; countRec++)
{
imgName = "imgStar" + String(countRec);
document.images[imgName].src = "images/starGold.gif";
}
// for (countRec = parseInt(sMessage)+1; countRec<=5; countRec++)
// {
// imgName = "imgStar" + String(countRec);
// document.images[imgName].src = "images/starWhite.gif";
// }
}
</script>
<asp:Image ID="imgStar1" name="imgStar1" runat="server" onClick="onImgClick('1')" onMouseOver="callSwapImage('1')" onMouseOut="callSwapRedo()" AlternateText="1" ImageUrl="~/images/starWhite.gif"/>
<asp:Image ID="imgStar2" name="imgStar2" runat="server" onClick="onImgClick('2')" onMouseOver="callSwapImage('2')" onMouseOut="callSwapRedo()" AlternateText="2" ImageUrl="~/images/starWhite.gif"/>
<asp:Image ID="imgStar3" name="imgStar3" runat="server" onClick="onImgClick('3')" onMouseOver="callSwapImage('3')" onMouseOut="callSwapRedo()" AlternateText="3" ImageUrl="~/images/starWhite.gif"/>
<asp:Image ID="imgStar4" name="imgStar4" runat="server" onClick="onImgClick('4')" onMouseOver="callSwapImage('4')" onMouseOut="callSwapRedo()" AlternateText="4" ImageUrl="~/images/starWhite.gif"/>
<asp:Image ID="imgStar5" name="imgStar5" runat="server" onClick="onImgClick('5')" onMouseOver="callSwapImage('5')" onMouseOut="callSwapRedo()" AlternateText="5" ImageUrl="~/images/starWhite.gif"/>
---------------------------------------------------------------
Following is the code for code behind of the same
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class RatingControl : System.Web.UI.UserControl
{
public string rateFor;
public int currentRating;
public string txtMsg;
public string sCallBackFunctionInvocation;
protected string returnValue;
protected string totChecked;
protected void Page_Load(object sender, EventArgs e)
{
sCallBackFunctionInvocation = Page.ClientScript.GetCallbackEventReference(this, "message", "ShowSuccess",
"context");
String callbackScript;
callbackScript = "function CallServer(message, context)" +
"{ " + sCallBackFunctionInvocation + ";}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"CallServer", callbackScript, true);
}
public void RaiseCallbackEvent(string eventArgument)
{
int countRec;
int remCount;
string imgButName;
//if (eventArgument == "0")
//{
// for (countRec = 1; countRec <= 5; countRec++)
// {
// imgButName = "imgStar" + countRec.ToString().Trim();
// ((Image)this.FindControl(imgButName)).ImageUrl = "images/starWhite.gif";
// }
// returnValue = eventArgument;
//}
//else
//{
// currentRating = Convert.ToInt16(eventArgument);
// remCount = 5 - currentRating;
// for (countRec = 1; countRec <= currentRating; countRec++)
// {
// imgButName = "imgStar" + countRec.ToString().Trim();
// ((Image)this.FindControl(imgButName)).ImageUrl = "images/starGold.gif";
// }
// returnValue = eventArgument;
//}
returnValue = eventArgument;
}
public string GetCallbackResult()
{
return returnValue;
}
}
------------------------------------------------------
The problem I am facing is that when I click on an image to rate, the OnMouseOut also activates and the images don't show rated.
Also, since I am a novice, I dont know how to pass value of rating on image clicking to the page that implements the control.
Please help
-----Have A Nice Day-----
|
|
|
|
|
you can use simple javascript or builtin AJAX control for this purpose...
Nothing is Impossible. Keep always Smiling...
|
|
|
|
|
I know, but I wish to make my own control
-----Have A Nice Day-----
|
|
|
|
|
Hi,
i am using asp.net 2.0 , C# , VS2005.
In a web page i have six dropdownlist control and couple of checkbox list .
On add button click i have to display it to gridview control(as this row can be editable) . further i have to insert whole data to database
please suggest me ways of doing the same. or give some important link.
Thank you.
regards
imran khan
|
|
|
|
|
I m not getting what this second line says
On add button click i have to display it to gridview control(as this row can be editable).
As i understand from that,
On page load ur grid is empty Then u Click add Button at that time u want to show all ur controls appear in grid and then add data to ur database.
And this thing u want done with the controls placed in grid?
Believe Yourself™ :->™
|
|
|
|
|
is it port number 1433?
thanks
|
|
|
|
|
Yes, SQL talks over TCP 1433 unless you use the Netowrk Configuration tool to change that port.
|
|
|
|
|
Hi,
I want to create Questions on the form.
Form contains 1 question at a time.
I have arraylist with number of questions.
From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question.
How Can I Do this?
Thanks
|
|
|
|
|
sjs4u wrote: I want to create Questions on the form.
Form contains 1 question at a time.
I have arraylist with number of questions.
From that arraylist I want to get the question and depending upon the next and prev button I want to circulate the question.
How Can I Do this?
if(!ispostback)<br />
{<br />
viewstate["index"]="0";<br />
}
On Next Button event
if (viewstate["index"].ToString()=="0")<br />
{<br />
int.parse(viewstate["0"]) +=1;<br />
}<br />
else<br />
{<br />
<br />
string quest=arrlist[int.parse(viewstate["index"])]<br />
<br />
if(int.parse(viewstate["index"])==arrlist.count){<br />
}
On Previous Button event
if (viewstate["index"].ToString()=="0")<br />
{<br />
int.parse(viewstate["0"]) +=1;<br />
}<br />
else<br />
{<br />
<br />
string quest=arrlist[int.parse(viewstate["index"])]<br />
int.parse(viewstate["0"]) -=1; <br />
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
...or he could do his homework himself
|
|
|
|
|
Hi All,
Here i m stucked with a problem and devoted my best half the day to solve the same but cant get any sucess.
my problem is, i want to trace the browser close button event and perform some operation on the same.
I have tried all the things like window.close(), onunload event but cant able to find the correct sollution.
i dont want my function to call at page refresh, i wants to call the same only when user clicks to X button of browser.
Please help
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
You can Icallback and execute your code in code behind side before closing window.check return argument and you can close window.
The other way is create one method in code behind side and call this method using javascript and close window
for example
In html source page
<a href="javascript:CloseWIN();" >Close</a>
In code behind side
function void CallMethod()
{
//code here
}
javascript
<script .................>
function CloseWIN()
{
<% CallMethod() %>
window.close();
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
hi,
anybody know hoe to Determin if a page is PostBack in JavaScript
Nothing is Impossible. Keep always Smiling...
|
|
|
|
|
I think u want server side validation that been done from client side? Is it so?
Believe Yourself™ :->™
|
|
|
|
|
yes.......
Nothing is Impossible. Keep always Smiling...
|
|
|
|
|
U can try by putting an alert to the very beginning of a javascript to check.
Believe Yourself™ :->™
|
|
|
|
|
Hi,
I have dataset in that by using the for loop i am binding the values to the dataset that means each time dataset value will be increse or decrese.
Depending upon that these values will have to added into then arraylist.
Thanks
|
|
|
|
|
Hey
I'm having problems connecting from sql server to the web server
anyone know any good troubleshooting articles
Ive looked on the internet but nothing seems to help me
thanks in advance
|
|
|
|