|
You can not apply the border to alernate rows usaing AlternateItemStyle.
Grid View indirectly generates Table structure.
Whatever style you applied to AlternateItemStyle, it paste into inside <tr> tag. And you can not set the border using tr tag.
|
|
|
|
|
Thanks a lot for ur reply.
I tried with onrowdatabound event and its working fine...
beula
|
|
|
|
|
Can you please share the code?
|
|
|
|
|
Hi All,
I m using Datalist. In that I am using Link button where I m binding 1 value to link button. Its working fine.
Now I want to bind 2 values i.e. I want to bind concatinate string. How Can I do this?
Thanks
sjs
|
|
|
|
|
sjs4u wrote: I m using Datalist. In that I am using Link button where I m binding 1 value to link button. Its working fine.
post the codes for this one plzzzzzzzzzz....
|
|
|
|
|
at design
<asp:linkbutton> ID="lnk_year" Text= '%#Server.HtmlEncode(DataBinder.Eval(Container, "DataItem.Test").ToString()) %'runat="server" oncommand="lnk_year_Command"
code behind
try
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
DataRowView drv = (DataRowView)e.Item.DataItem;
LinkButton lnk = (LinkButton)e.Item.FindControl("lnk_year");
lnk.CommandArgument = drv["TestID"].ToString();
lnk.Text = drv["Test"].ToString();
}
}
catch (Exception ex)
{
}
i m now assigning Test value to link button Now I want to assign Test and Date(other database field) value to same Link button
|
|
|
|
|
Hope this will be helpful
<asp:LinkButton> ID="lnk_year" Text= '<%#Server.HtmlEncode(DataBinder.Eval(Container.DataItem, "Field1").ToString()+ " " + DataBinder.Eval(Container.DataItem, "Field2").ToString()) %>' runat="server" oncommand="lnk_year_Command" />
|
|
|
|
|
when i changed my authentication mode to forms and in login page when i write this code
FormsAuthentication.SetAuthCookie(txtUserName.Text.Trim, False)
automatically the user information is saving my db where i used custom sql provider to save the values in my data base.and when that particular user login again the same settings are comming what he made in the previous login....
how can i work my project for windows authentication as like forms authentication
|
|
|
|
|
Hi i have a string like this:
string lgtext=text5,text2,text6,text4;
now i have another string :
string shtext= text2;
now the lgtext contained that second string(shtext) or not have to test...,
how to split and execute it..,.
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
here:
protected void Button1_Click(object sender, EventArgs e)
{
string lgtext = "text5, text2, text6, text4";
string shtext = "text2";
string[] split = lgtext.Split(',');
for(int i=0;i< =split.Length-1;i++)
{
if (split[i].Trim() == shtext)
Response.Write("Found");
}
}
|
|
|
|
|
Hi padmanabhan thanks for ur reply...,
we can use this following method it will work fine?
if(lgtext.indexof(shtext)!=-1)
{
'found'
}
else
{
'not found'
}
is't ok?
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
Why would you even split this?
String class has Contains method. Use it.
|
|
|
|
|
d@nish wrote: String class has Contains method. Use it.
contains method won't give exact search..
eg., string search = text1,text2,text3,text4;
if we want to search for "text" in this, by using contains will give found message for all the condition. But my output must be exactly "text" which is not present in the string.
so, for most of the requirements contains wont provide exact result.
|
|
|
|
|
Agreed.
Provided the string structure remains same, check for the trailing comma as well after the text to match. This would work.
|
|
|
|
|
This will not work for below string
string lgtext = "text5, text2, text6, text4, text7text8 ";
And you have find exact "text8".
if you use Contains then it returns true but text8 is not in the collection.
So better to use below code.
protected void Button1_Click(object sender, EventArgs e)
{
string lgtext = "text5, text2, text6, text4";
string shtext = "text2";
string[] split = lgtext.Split(',');
for(int i=0;i&lt; =split.Length-1;i++)
{
if(split[i].Contains(shtext))
Response.Write("Found");
}
}
|
|
|
|
|
Hello,
I am using VS 2005. I have put the Crystal Report Viewer on my web page; its running fine and output are displaying in the browser. I wish to generate the dos based text file (.Txt) as per output shown in the crystal report with appropriate margins, so that i would be able to further print the text file on Wipro's Line Matrix Printer or mail the same.
A simple sample example will be high appreciated please.
Thanks & Regards
Girish Sharma
|
|
|
|
|
im adding event handler to dynamically added linkbutton that is in dynamically added table and that is in content page, but event does not fire. any suggestions will be appreciated.
|
|
|
|
|
your code plzzzzzzz....
|
|
|
|
|
code to add the event handler:-
*****************************
strLinkButtonID = null;
strLinkButtonID = (string.IsNullOrEmpty(drRows["FormFields"].ToString()) ? "0" : drRows["FormFields"].ToString()) + ("_") + (string.IsNullOrEmpty(drRows["Form"].ToString()) ? "0" : drRows["Form"].ToString());
lbUploadedFile = new LinkButton();
lbUploadedFile.ID = strLinkButtonID;
lbUploadedFile.Text = strFieldValue;
lbUploadedFile.Click += LnkUploadFile_Click;
tbCellFieldVal.Controls.Add(lbUploadedFile);
Event Handler:-
******************
protected void LnkUploadFile_Click(object sender, EventArgs e)
{
try
{
string strLnkButtonID = ((LinkButton)sender).ID.ToString();
}
catch (Exception ex)
{
}
}
|
|
|
|
|
S_Aijaz1 wrote: lbUploadedFile.Click += LnkUploadFile_Click;
instead of the above correct like this:
lbUploadedFile.Click += new EventHandler(LnkUploadFile_Click);
//If getting the same error try to paste your page load code out of postback
if(!page.ispostback)
{
//dont write here
}
//your code
|
|
|
|
|
thnks it really worked. but dere is a problem when i bind data on !postback event does not fire. if i bind it without !postback den event gets fired. any suggestions
|
|
|
|
|
//You have to understand the postback functionality first:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//every single code written inside this will fire, only when page load or when redirected and from another page.
//the datas will be maintained here
}
//the code written here will be fired before each and every event is done.
//the data will change as per the old value and then the events like button click and others will be fired.
}
|
|
|
|
|
Hi want to go for cookie concept...,
When my user click a button a cookie have to save...,
after that if he click once agian another cookie also want to save with already existed cookie...,
and finally i want to get all the cookies...,
plz give me some idea reg this...,
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
i am using 2 textboxes and a checkbox and button:
//code for aspx.cs page:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
HttpCookie coo = Request.Cookies["Info"];
if (coo != null)
{
txtfirst.Text = coo["name"];
txtsecond.Text = coo["name1"];
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (CheckBox1.Checked == true)
{
HttpCookie cook = new HttpCookie("Info");
cook["name"] = txtfirst.Text.ToString();
cook["name1"] = txtsecond.Text.ToString();
cook.Expires = DateTime.Now.AddDays(1);
Response.Cookies.Add(cook);
}
}
//Add this line in web.config.
< sessionState
cookieless="UseCookies" />
|
|
|
|
|