|
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" />
|
|
|
|
|
|
|
its not what i asked dera,
i asked if cookie will be there with that new cookie also have to add
like insert concept...,not update concept
Thanks & Regards,
Member 3879881,
please don't forget to vote on the post
|
|
|
|
|
I currently have a website using master content technology. The Master page has two menus but only one is shown at a time. The problem I am having is that when rendering on IE 8, some browsers show the menu centered correctly on the page and other IE 8 browsers show the main menu starting at the center of the page. Below is the markup for the master page. Does anyone have any Ideas what the problem is?
<%@ Master Language="C#" CodeFile="Default.master.cs" Inherits="Default_master" %>
<%@ Import Namespace="System.Data.Odbc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head id="Head1" runat="server">
<title>Hans Engineering</title>
<link href="/White/NavButtons.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Scripts>
<asp:ScriptReference Path="~/Scripts/AutoSave.js" />
<asp:ScriptReference Path="~/Scripts/Main.js" />
<asp:ScriptReference Path="~/scripts/Resources.js" />
</Scripts>
<Services>
<asp:ServiceReference Path="~/MessageBoardService.asmx" InlineScript="True" />
<asp:ServiceReference Path="~/UserService.asmx" InlineScript="True" />
</Services>
</asp:ScriptManager>
<div style="width:789px; height:150px">
<h1>Hans</h1>
<h2>Engineering WebSite</h2>
 <div style="left:40%;position:absolute">
<asp:Button ID="LinkButtonAjax" runat="server"
Text="AJAX ONLY" onclick="LinkButtonAjax_Click"></asp:Button>  <asp:Button
ID="LinkButtonASP" runat="server"
Text="STANDARD ASP" onclick="LinkButtonASP_Click"></asp:Button></div><br /><br /><br /><br /><br /><br /><br />
<div style="position:absolute; margin-left:100px">
<asp:menu id="menu" runat="server"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
skiplinktext=""
staticdisplaylevels="2"
Width="95%" Font-Bold="true" Font-Size="Small" StaticMenuItemStyle-HorizontalPadding="35" >
<Items>
<asp:MenuItem Text="Home" NavigateUrl="~/Default.aspx" />
<asp:MenuItem Text="Login" NavigateUrl="javascript:showLoginUser()" />
<asp:MenuItem Text="Register" NavigateUrl="~/Register.aspx" />
<asp:MenuItem Text="Discussions" NavigateUrl="~/Discussions.aspx" />
<asp:MenuItem Text="Forums" NavigateUrl="~/Forums.aspx" />
<asp:MenuItem Text="Administrative" />
<asp:MenuItem Text="Profile" NavigateUrl="~/UserProfile.aspx"/>
<asp:MenuItem Text="Help" />
</Items>
</asp:menu>
</div>
<div style="position:absolute; margin-left:100px">
<asp:menu id="menuASP" runat="server" Visible="false"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
skiplinktext=""
staticdisplaylevels="2"
Width="95%" Font-Bold="true" Font-Size="Small" StaticMenuItemStyle-HorizontalPadding="35" >
<Items>
<asp:MenuItem Text="Home" NavigateUrl="~/DefaultASP.aspx" />
<asp:MenuItem Text="Discussions" NavigateUrl="~/DiscussionsASP.aspx" />
<asp:MenuItem Text="Forums" NavigateUrl="~/ForumsASP.aspx" />
<asp:MenuItem Text="Administrative" />
<asp:MenuItem Text="Profile" NavigateUrl="~/UserProfileASP.aspx"/>
<asp:MenuItem Text="Help" />
</Items>
</asp:menu>
</div>
<div class="nav">
|
<asp:LoginStatus ID="LoginStatus1" Runat="server" />
</div>
</div>
<asp:contentplaceholder id="Main" runat="server" />
<div class="footerbg">
<div class="footer">
<asp:menu id="menub" runat="server"
orientation="Horizontal"
maximumdynamicdisplaylevels="0"
skiplinktext=""
staticdisplaylevels="2" />
Copyright © 2009 Hans Holdorf.
</div>
</div>
</form>
</body>
</html>
|
|
|
|
|
I would expect that ASP.NET doesn't know how to deal with the js quirks in IE8 yet. I would try to change your CSS, do things differently until it works. I'd also google for info, it's odd that IE8 would work differently for different users.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Actually, after further testing the problem is not with IE 8. The menu rendering incorrectly is with IE 7. I had my source check their version of IE and they are in fact haveing problems with IE 7. Still the problem remains. Any suggestions?
Thanks,
Steve
|
|
|
|
|
Ultimately, it means that IE7 has the issue, and you need to work out what the issue is, and change your script accordingly. Welcome to the hell of web development.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
To resolve this problem you have to write only one line in your section of that page where you had placed menu control.
SOLUTION:
Try it. might resolve your problem.
Regards
Keyur Satyadev
|
|
|
|
|
I am using asp.net with C# language.
I want a code through which i can create a table in oracle 9i database through user interface (asp.net) with C# language. After creation of a new table in database, I should even be able to insert data in it through user interface itself.
I am urgently in need of it.
Please somebody help me out in this code.
|
|
|
|
|
Maybe you are looking for this[^]
|
|
|
|