|
on page load iam getting one file upload control by default.when user clicks on add button then another file upload control is to be added how could be possible.
|
|
|
|
|
Hi Jagadeesh!
Try this[^]
Go to here[^]
Hope the above two link give you idea about adding controls at runtime.
Regards.
|
|
|
|
|
Hello Everybody
I have a big problem.
Actually I have an asp.net ImageButton and in it's click event I do some code.
When I click the button the code is executed.But after that when I refresh the page again the click event called and the code was executed.So that in my database entry was dubbled.
Please help me out.
Thanks in advance
Happy Coding
A key to every Solution
|
|
|
|
|
This article[^] explains how to tackle the problem.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
HI,
I am having a command button and i want to find a cell value from the grid based on the associated command button.
I have used the following code:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "btnsubmit")
{
int index = Convert.ToInt32(e.CommandArgument);
GridViewRow selectedRow = ((GridViewRow)e.CommandSource).Rows[index];
string item = selectedRow.Cells[1].Text.ToString();
Response.Write(item);
}
}
I am getting an error that input is not in correct format. on the line while getting index.
Deepak Nigam
|
|
|
|
|
Does anyone has an example of five star rating control implemented using Callbacks in ASP.Net 2.0 and C#.
-----Have A Nice Day-----
|
|
|
|
|
Don't double post. It's rude.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
Is it possible to call a dll file (methods inside the file) from java script ? if yes then how?
Any idea !!!!
Thanks in advance !!!!!
|
|
|
|
|
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
|
|
|
|