|
I guess you add radio buttons and make sure the id matches so that they are part of the list. They will not appear in your codebehind tho, because they won't exist when the control tree is created. In this case, you'd add a hidden server control, and add script so that the button selected is stored there, so you can access it on the server side.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes , we have to use hidden control but how to add the listitems to the radiobuttonlist in javascript.
|
|
|
|
|
you don't know how to add items in javascript at all ? you should google for that, there are tons of articles about.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
i need to highlight a particular column in asp menu in when the page redirects with that column name in master page on page load like StaticHoverStyle.
i.e. without mouse hover on menu , i need to highlight menu in master page.......
in asp.net, c#
Ashok
|
|
|
|
|
I am getting full Image URL using web.config file
"<%=Common.CommonUtil.GetConfigValue("ImageURL")%>/images/Menuibtn.JPG"
there is any other way so I can get this path directly in aspx page only and no need to specify any value in web config file.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
"images/Menuibtn.JPG"
will give you the images folder at the root of the web app. Why do you need more ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello,
I am developing application in which i m saving the data in database from admin section and show it to client side.for that i use contentplaceholder to show my data and use it with pagemethods.
Like
1)call pagemethod with Id which returns specific data from database
2)get that data in pagemethods callback function and place it in content
Placeholders innerText
function which calls pagemethod which returns txtContent as my database data
-----------------------------------------------------------------------
function FetchData()
{
PageMethods.FetchContent(intID,CallBackFuntion);
}
function CallBackFuntion(txtContent)
{
document.getElementById('<%= pnlContent.ClientID %>').innerHTML = txtContent;
}
now everything works fine for simple content but now i have one situation,
Where i have one script which Loads one image and on click of it one popup opens.
if i put that script directly on page the functionality works completely.
but when i save that script in database and than use my above pagemethod to render it on my placeholder it shows nothing.
I had search lot on web but dont find any answer..
So if any body has idea than give the solution for it....
Thanx in advance...
Ritesh Ravlani,
Software Developer.
|
|
|
|
|
In the login control, there is a property for saving the password with a check box.i need the code other than the login control.I use seperate textboxes and check box to create login page.If any one know this pls give the code

|
|
|
|
|
U will have to use cookies for it. Save ur Password in Cookies...
|
|
|
|
|
i use the following code to save cookies
is this correct.
HttpCookie cookie = new HttpCookie("cookiename");
cookie.Values.Add("UserName", TextBox1.Text);
cookie.Values.Add("Password", TextBox2.Text);
cookie.Expires = DateTime.Now.AddDays(30);
|
|
|
|
|
Use this javascript Function:
function readCookie(cookies)
{
var txtuname;
var txtpass;
var chkRememberLogin;
if(document.getElementById('ctl00_CustomLogin_txtUserName') != null)
{
txtuname = document.getElementById('txtUserName');
txtpass = document.getElementById('txtPassword');
chkRememberLogin = document.getElementById('chkCookie');
}
else
{
txtuname = document.getElementById('txtUserName');
txtpass = document.getElementById('txtPassword');
chkRememberLogin = document.getElementById('chkCookie');
}
if (document.cookie.length>0 && txtuname.value.length>0 )
{
// check the index of the username that is entered by user in Username text box
var c_start=document.cookie.indexOf(txtuname.value);
if (c_start!=-1)
{
var c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1)
{
c_end=document.cookie.length;
}
var value= unescape(document.cookie.substring(c_start,c_end));
var arr = new Array(10);
arr= value.split('=');
// if only 0ne equal sign is present that is default one
if(arr[0]==txtuname.value && arr.length==2)
{
txtpass.value=arr[1];
chkRememberLogin.checked = true;
}
// if the password contain =(equal) signs in it
else if(arr[0]==txtuname.value && arr.length > 2)
{
var pass=arr[1];
for(i=2;i<arr.length;i++)>
{
pass += arr[i];
}
txtpass.value=pass;
chkRememberLogin.checked = true;
}
else
{
txtpass.value="";
chkRememberLogin.checked = false;
}
}
else
{
txtpass.value="";
chkRememberLogin.checked = false;
}
}
else
{
txtpass.value="";
chkRememberLogin.checked = false;
}
}
In Page Load Put this:
txtPassword.Attributes.Add("OnFocus", "javascript:readCookie('" & Request.Cookies.ToString() & "');")
Above line will get the password in password textbox on focus event.
Finally on Login Button Click Event where u have to store password in cookies:
If chkRememberMe.Checked Then
Dim cookie As New HttpCookie(txtUserName.Value)
Response.Cookies.Add(cookie)
cookie.Values.Add("", txtPassword.Value + ";")
Response.Cookies(txtUserName.Value).Expires = DateTime.Now.AddDays(15)
Else
Response.Cookies(txtUserName.Value).Expires = DateTime.Now
End If
Hope this helps u....
|
|
|
|
|
I would NEVER save a username/password in a cookie, which a user can read on their PC if they know how. I would store a GUID in a cookie and in your DB, associate that GUID with a login id. This means the client side doesn't have the username/password combo, but you can log them in.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hello All,
I am working in ASP.NET 2008 (C#). I have to keep user logged in till he logout's. I did the following but its not working in all Pages. Specially on that page where I have used Web Parts.
function KeepmeLoggedIn()
{
if ('<% =keepmeloggedin %>' != '')
{
var sessionTime = (10 * 60000) - 30000;
window.setInterval('window.location.reload()',sessionTime );
}
}
Above Function is call in the body tag of Master Page, something like this:
In code Behind of Master Page:
public string keepmeloggedin = "";
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["Collabs"] != null)
{
HttpCookie cookie = Request.Cookies.Get("Collabs");
keepmeloggedin = cookie.Values["keepmeloggedin"].ToString();
KeepMeLogedIn.Text = keepmeloggedin; //KeepMeLogedIn is TextBox
KeepMeLogedIn.Visible = false;
}
}
On Login User Control I have this:
If chkKeepLoggedIn.Checked Then
Dim cookie As New HttpCookie("Collabs")
Response.Cookies.Add(cookie)
cookie("keepmeloggedin") = "true"
Response.Cookies("Collabs").Expires = DateTime.Now.AddDays(15)
Else
Dim cookie As New HttpCookie("Collabs")
Response.Cookies.Add(cookie)
cookie("keepmeloggedin") = ""
Response.Cookies("Collabs").Expires = DateTime.Now.AddDays(15)
End If
Above code works fine sometimes and sometime it doesnt.
Please help me...
Thanks in advance...
|
|
|
|
|
Please edit your question using proper
pre code tags
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
I am using sql server 2000 as backend for .net application.When i upgrade the sql server to service pack 4,i cant execute the crosstabs.An error occurs.How can i solve this error.
|
|
|
|
|
Check this[^]
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Hi , i want to create a textbox in runtime , so i use panel and create textbox at runtime which is in gridview . now when we fill value in textbox and then click save button then nothing happand . now tell me what i have to do . Basically i want textbox at runtime in a gridview .
code:
for (int i = 0; i < GridView2.Rows.Count; i++)
{
Label name = (Label)(GridView2.Rows[i].FindControl("lab3"));
cms.itemname = name.Text;
string yesornoitem = cms.Checkunique_forItem();
string yesnogroup = cms.Checkunique_forGroup();
if (yesornoitem == "Y")
{
Label qty1 = (Label)(GridView2.Rows[i].FindControl"lab4"));
int ii = Convert.ToInt16(qty1.Text);
for (int j = 0; j < ii; j++)
{
TextBox t = new TextBox();
Panel panel4 = (Panel)(GridView2.Rows[i].FindControl("Panel4"));
panel4.Controls.Add(t);
t.Style.Value = "width:75px";
}
}
}
Thanks .
|
|
|
|
|
I think your need is TextBox in Girdview, You can easly add TemplateItem in to the Gridview, like ordinary column insertion throug smart tag.
then edit this item template and add a textbox in thier.
you can easly fetch the value of textbox by
textbox txt=(textbox)grdview1.[index].findcontrol("name of the textbox in gridview");
string var=txt.text;
kkkkkkkkkkk..
|
|
|
|
|
hi thanks for your reply .. But the problem is this i want some textbox (that can be 10 or even more than 50) at runtime in gridview . for that i use Panel (and add textbox in runtime) in gridVies's coloum . after that i want to fill all textbox with values and save them together, bt nothing happend . Is it possible i find every textbox in panel so that i save text from all the textboxes .
|
|
|
|
|
i am a bigginer so i want to know how can i let some one to download a file from my website
N.Asgari
|
|
|
|
|
Best method is
Search.... File Download.... article in codeproject.com
|
|
|
|
|
Did you mean this![^]
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Can any one look for image compress code in c# code. If we select one folder. Then it should read each image and compress the image size. Even if it converts tiff format then also no problem.
for example if an image size is 200kb, i need to compress it to 80kb.
Pradeep Reddy
|
|
|
|
|
Do your homework yourself!
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Hi.
I am trying to do a Serial Port I/O on multiline text box on web, client side, in windows app we have:
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!serialPort1.IsOpen) return; //don't send if the port is close
char[] buff = new char[1];
buff[0] = e.KeyChar;
serialPort1.Write(buff, 0, 1);
e.Handled = true;
}
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
RxString = serialPort1.ReadExisting();
Invoke(new EventHandler(DisplayText));
}
private void DisplayText(object sender, EventArgs e)
{
textBox1.AppendText(RxString);
length = textBox1.Lines.Length;
thescript();
}
And i tryied to write something like this for the web client but there is no the event and the invoke function.
how i can to do this?
thanks.
|
|
|
|