|
Well, you should have told us what the error was. This code is terrible.
yamunarani wrote: ArrayList
Why use an arraylist ? Is this ASP.NET 1.0 ?
yamunarani wrote: StringList.Add(source.Substring(a, 10));
Here is your problem. You assume there's 10 characters. Of course you'll get an error if there is not. Work out the string length in code instead.
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.
|
|
|
|
|
Hi,
I know that the problem is with the code i used StringList.Add(source.Substring(a, 10));
i tried in other way too,but i dint get the required solution it is failing in other way
if any one knows the exact solution plz reply me
thanks in advance
yamuna
|
|
|
|
|
TRY THIS ONE.
public string WrappedString(string Source)
{
int count = 0;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
foreach (char c in Source)
{
count++;
sb.Append(c);
if (count == 10)
{
count = 0;
sb.Append("< br >");
}
}
return sb.ToString();
}
please don't forget to vote on the post that helped you.
|
|
|
|
|
I have a textbox inside an AJAX updatepanel. The textbox has autopostback
set to true and the textchanged event declared.
When I come into the page, I pre-load the textbox with a value. If I
change the value and either tab or click away, the event is fired,
however, the textbox.text value has my OLD value not the new value I have
just entered.
My Code is like this
<asp:UpdatePanel Id="Upd1" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:TextBox ID="txtUser" runat="server" AutoPostBack="true" OnTextChanged="txtUser_TextChanged">
</asp:TextBox>
</td>
<td>
<asp:TextBox ID="txtPwd" runat="server">
</asp:TextBox>
</td>
</tr>
</ContentTemplate>
</UpdatePanel>
modified on Thursday, October 8, 2009 11:48 AM
|
|
|
|
|
Good Day
Put a Break point in your text-changed event and Debug it. please Post your code in the text-changed event and maybe we can help you there.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
is it good practice to store dataset in session.
|
|
|
|
|
No, but it is a good practice to read this[^], look at #3
only two letters away from being an asset
|
|
|
|
|
Sneha Bisht wrote: is it good practice to store dataset in session.
It Depends on the size of DataSet. What you are going to store in DataSet ? If this is normal user information its always better to use in normal variable rather than dataset.
As per the data size of concern try to avoid dataset, datatable to store in session.
|
|
|
|
|
Datasets Are Expansive.
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Usually you'd store an id in the session and use that to define what dataset you need to get from the database.
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.
|
|
|
|
|
Respected,
Add Calender Control In Asp.Net GridView Control without PostBack The Page
|
|
|
|
|
Sorry, did you have an actual question ?
I THINK you want to know how to add a calendar control that doesn't do a postback when you select. Just find a javascript one online and put it into your page.
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.
|
|
|
|
|
|
Hi,
I am using Text file. Using StreamWriter I am writing some line in the file.
Then I close that file using StreamWriter.Close()
After the closing the file. I am again opening the same file for reading purpose.
I read some data for checking and again write into the same file using StreamWriter. At that time is showing me error "Cannot write to closed Textwriter".
I want to use the same file for writing.How can i do?
Thanks
Sjs
|
|
|
|
|
This has nothing to do with ASP.NET. Create a new streamwriter, apparently you can't reopen one you closed.
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.
|
|
|
|
|
hi,
I dont know which framework are u using? but if u r using framework 3.5, I recommed u to use the streamreader and streamwriter objects in using keyword e.g.,
using (StreamWriter sw = new StreamWriter(path))
{
sw.WriteLine("This");
sw.WriteLine("is some text");
sw.WriteLine("to test");
sw.WriteLine("Reading");
}
using (StreamReader sr = new StreamReader(path))
{
while (sr.Peek() >= 0)
{
Console.WriteLine(sr.ReadLine());
}
}
Hope this helps.
Regards,
Atif Ali Bhatti.
|
|
|
|
|
i have hide a div using jquery like $("#div1").hide(); in $(document).ready{};
when mypage loads this div shows once then hide.
One person's data is another person's program.
--J.Walia
|
|
|
|
|
I guess the code takes a second to run. If you want it hidden on load, hide it in the code behind.
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.
|
|
|
|
|
hi,
if u want the div to be hidden on page load, good thing will be to add
style="display:none;" to the div.
e.g.,
<div id='div1' style="display:none;">your content here.</>
and later u can show it by using $('#div1').show();
Regards.
Atif Ali Bhatti
|
|
|
|
|
thanks for reply
i will try this
One person's data is another person's program.
--J.Walia
|
|
|
|
|
I completed my personal web page. and I hosted that in a free webhosting site. Now my Problem is
1. How to show my web page content topmost in Search Engine like Google, Yahoo, Msn etc...
2. I m searching my website name then also i can't search in any above search engine.
|
|
|
|
|
|
non-bugging Errors wrote:
1. How to show my web page content topmost in Search Engine like Google, Yahoo, Msn etc...
Pay them. Modern search engines are not as easy to fool, and if there is a way, you'd use it today and someone else would use it to be above you tomorrow.
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.
|
|
|
|
|
im using repeater control retrieving a table with four rows from sql.
one column is to active or inactive the users, when i click on linkbutton to active or inactive single user all users are activated or deactivated.
following is the code....
in sql table i had column active with values '1'(active) and '0'(inactive)
help me what im missing or any sample code....
in repeater item command
if(commandname=="inactive")
foreach (DataRow row in dt.Rows)
{
if (row["Active"].ToString() == "0")
{
update tb_staff set Active=1 where Active=0
}
if (row["InActive"].ToString() == "1")
{
update tb_staff set Active=0 where Active=1
}
}
|
|
|
|
|
Hi,
You have to update the table with 'update tb_staff set Active=0 where ID=command argument'. Please send the id of the corresponding record to the link button as commmand argument.
|
|
|
|