|
that is Simple
DropDownList ddl = (DropDownList)e.Row.Cells[0].FindControl("ddlVariable");
as i dont know what column is this template field is, you can start counting from zero and but the correct index for the column
Hope this Helps
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
what should be the code for server side scripting?
|
|
|
|
|
its what i gave you
Vuyiswa Maseko,
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.somee.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
there itself near the dropdown u can add listitems
|
|
|
|
|
i want to take values from textbox and using a submit button i want to submit the records.
when i run the project it give errorFailed to convert parameter value from a String to a DateTime
Here is my code plz chk and reply
protected void btnSubmit_Click(object sender, EventArgs e)
{
try
{
ErrorMessage.Text = "";
cnx.Open();
SqlCommand insertCmd = new SqlCommand("insert into Coupon_Info(ReceivingDate,Coupon_TypeID,Serial_Start,Serial_End,Recieved_By)values(@date,@CouponId,@Start,@End,@By)",cnx);
insertCmd.Parameters.Add("@Date", SqlDbType.DateTime);
insertCmd.Parameters["@Date"].Value = txtdate.Text;
insertCmd.Parameters.Add("@CouponId", SqlDbType.TinyInt);
insertCmd.Parameters["@CouponId"].Value = DropDownList1.Text;
insertCmd.Parameters.Add("@Start", SqlDbType.BigInt);
insertCmd.Parameters["@Start"].Value = txtbxFrom.Text;
insertCmd.Parameters.Add("@End", SqlDbType.BigInt);
insertCmd.Parameters["@End"].Value = txtbxTo.Text;
insertCmd.Parameters.Add("@By", SqlDbType.NVarChar, 50);
insertCmd.Parameters["@By"].Value = txtbxBy.Text;
insertCmd.ExecuteNonQuery();
ErrorMessage.Text = "Successful";
cnx.Close();
}
catch (Exception ex)
{ ErrorMessage.Text = ex.Message; }
}
|
|
|
|
|
|
hiii all....
i m using access database in my web site.
I want to use role and membership feature in my application.
tell me wheather i shud use customize provider or notplz guide me.
thanks in advance....
|
|
|
|
|
Hi all,
I want to allow the user to enter his password and press a confirm button from within his email. On the press of the button i need to do some serverside operations. Is this possible? Can we embed HTML controls in a mail body? Or is there any other way to achieve this?
|
|
|
|
|
This is basically not possible. I can think of some things you could do, but at the end of the day, any mail program worth anything, even if it shows HTML, and even if it will show text boxes, etc. ( which I am not sure of ), is going to complain if you try to send data from their program.
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.
|
|
|
|
|
Thank you for your reply.
|
|
|
|
|
Hi All,
I want to implement Web Part in my Existing Project. We have implemented our own way for User Creation and User Role facility in our project.
As you know, To implement web Part We need to use pre-built Tables and Stored Procedures.
But We dont want to use all these rather we want to implement Web Part with our existing working functionality.
Is there any way to implement Web Part in such a way so that our existing user creation and Role tables do not need to do big changes.
Is this possible.
your help is appreciated.
Thanks.
Sdhimann
modified on Thursday, August 20, 2009 1:33 AM
|
|
|
|
|
Hey guys need ur help again. I need to check the valid email address using asp.net
Below are the code i use
hostName = "yahoo.com";
private bool ValidSMTP(string hostName)
{
bool valid = false;
try
{
TcpClient smtpTest = new TcpClient();
smtpTest.Connect(hostName, 25);
if (smtpTest.Connected)
{
NetworkStream ns = smtpTest.GetStream();
StreamReader sr = new StreamReader(ns);
if (sr.ReadLine().Contains("220"))
{ valid = true; }
smtpTest.Close();
}
}
catch (Exception e)
{
string a = e.Message;
}
return valid;
}
However the error msg i receive is this
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
Any solution or other methods of validating a exist email address?
Thanks
KaKaShi HaTaKe
|
|
|
|
|
There is no way to check if a mail address is valid, apart from mailing it and seeing if you get a bounceback message. Even that is not 100% accurate.
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.
|
|
|
|
|
after I get the id of the linkbutton (as follows), then how to change the backcolor of the button
I do not know which function can be used.
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
?
}
thanks.
|
|
|
|
|
Why you are not putting the LnkButton inside Div/Table and change the backcolor of that on mouseover of linkbutton.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
thanks, I did not get you, anyway, above method is suggested by you (right?)
can you help me further for this?
for your new proposal, can you give me one example, how to do it?
|
|
|
|
|
you know these codes should be rendered and then goes to the client , so if there was some thing unknown goes directly to client
so test this one :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="LinkBtnMouseOver();">link button</asp:LinkButton>
|
|
|
|
|
oops my text came half !!!
and add this one to java script:
NewID.style.backgroundColor = 'yourcolor';
|
|
|
|
|
thanks, unfortunately, no .style is supported by NewID.
it is strange that you can use .style?? I am using visual web developer 2008 express.
oh, unbelievable, when I type NewID.style.backgroundColor ="Blue", it does work!
but strange is that: when I type NewID. then all the functions within NewID should be automatically appear, but .style can not be found anyway.
do you know the reason? a bug or sth else?
|
|
|
|
|
yes i know it`s like this
i have visual studio enterprise , and it`s not supported very well here too !
but i think that on express mode many of features are not working
i think that just some stupid coder like me can Use these old "dhtml" commands !
but any how i love dhtml an i use it any where
|
|
|
|
|
thanks,
further question, as you know, I can solve this problem as follows, but I have many linkbuttons,
should I write different funcitons for different buttons, because the button ID is used in the funcitons,
how can I write one common function which can be used by all buttons by passing the ID or sth else?
function LinkBtnMouseOver() {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
NewID.style.backgroundColor = "Blue";
}
function LinkBtnMouseOut(obj) {
var LinkClientID = "<%=LinkButton1.ClientID%>";
var NewID = document.getElementById(LinkClientID);
NewID.style.backgroundColor = "Green";
}
|
|
|
|
|
ex me because it`s late night here , and i must go to bed
you can use something like this :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="LinkBtnMouseOver(this.id)" onmouseout="LinkBtnMouseOut(this.id)">link button </asp:LinkButton>
and change yur javascript to this mode :
function LinkBtnMouseOver(e) {
document.getElementById(e).style.backgroundColor = 'Blue';
}
function LinkBtnMouseOut(e) {
document.getElementById(e).style.backgroundColor = 'Green';
}
or maybe it works directly on your asp page totaly like this new one :
<asp:LinkButton ID="LinkButton1" runat="server" onmouseover="this.style.backgroundColor = 'Blue';" onmouseout="this.style.backgroundColor = 'Green';">link button </asp:LinkButton>
hope that it works
|
|
|
|
|
one other thing
if you found my postes helpful rate them !!!
|
|
|
|
|
thank you very much!
I have rated 5!
|
|
|
|
|
Why do you need javascript when there is no need. Javascript is slower than actual CSS AFAIK. Just a simple fix for you.
In Head section Add
<style type="text/css">
.lnk
{
background-color:Green;
}
.lnk:hover
{
background-color:Aqua;
}
</style>
Now inside Form create these
<asp:LinkButton CssClass="lnk" runat="server" >This is link
</asp:LinkButton>
Now see it should be working. Make appropriate alteration on the CSS.
|
|
|
|