|
i am saving user enterd multi line text box data in to data base and then
that data i want to disaly on label
but problem in next line character how to disaply that
|
|
|
|
|
best option display data in a table cell inside Div.
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
Hi!
when you save the text to the database, change the Environment.NewLine to in the text.
And when you are loading the text from the database, it is formatted correctly for a label.
If you want to load it back to a textbox, you need to replace the back to Environment.NewLine
Andreas Johansson
IT Professional at Office IT Partner i Norrbotten Sweden
What we don't know. We learn. What you don't know. We teach
|
|
|
|
|
When you display the text replace \n with <br>
|
|
|
|
|
Hi All,
I am using Ajax updatepanel, i place a button control in update panel, i wrote client script in button click event. but it is not working, after searching i realised that client script will not work when we use update panel.
I am Using Below Code for Opening Popup
Page.ClientScript.RegisterClientScriptBlock(Me.GetType, "View","<script language='javascript'>" & "window.open('Popup.aspx','','left=400, top=100, status=no, scrollbars=1, toolbar=no,location= no, menubar= no,target=_blank')" & "</script>")
I tried below also..but not working..
Response.Write("<script language='javascript'>window.alert('Record Generated successfully..!');</script>")
but it is not working..
I want Update Panel and i want to open Popup window...
Is their any alternate solutions for Opening Popup window...
Please Help me...
Urgent...
Pinna
|
|
|
|
|
haripinna wrote: I am using Ajax
Whenever you will Ajax, you have to use ScriptManager rather thant Page.ClientScript
Try to use
ScriptManager.RegisterStartupBlock(....)
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
Thanks Abhijit
Its Working...
Pinna
|
|
|
|
|
Hi guys
I have an arraylist which contains a number of items.
What is the best way to go through the items in the list.
ANy good tutorials on looping through the arraylist.
I need to loop through the arraylist and add the code from the arraylist to a sql statement to insert into a database.
thanks!
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Unless you are stuck with framework 1, you should not use an ArrayList at all, but the generic List class.
.netman wrote: What is the best way to go through the items in the list.
The easiest is a foreach loop. Example:
foreach (string name in listOfNames) {
...
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
So if I do:
ArrayList arrayitem = new ArrayList();
for (int i = 0; i < listbox1.Items.Count; i++)
{
if (listbox1.Items[i].Selected == true)
{
Session["itemsd"] += listbox1.Items[i].Text + " ";
Session["itemsc"] += listbox1.Items[i].Value + " ";
arrayitem.Add(listbox1.Items[i].Value);
}
}
foreach (string name in arrayitem )
{
}
How can I get the string value from the for each loop and add it into a stored procedure.
So basically for each row in the array I need to insert data into the database with the correct value.
thanks so far
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
try this
ArrayList arr = new ArrayList();
//add values to array list
foreach (object ob in arr)
{
//use ob
}
|
|
|
|
|
How can I loop the arraylist though and get the current value whilst im looping?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
|
I have found some code already but it doesnt seem to be working, Im using the following loop:
for (int i = 0; i < arrayitemdesc.Count; i++)
{
}
In it is a stored procedure which should be inserting data into the database. Im using arrayitemdesc[i] to get the value.
The problem is, nothing is being inserted itto the database.
Why is this?
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
.netman wrote: Why is this?
With the information you have provided, there is absolutely no way I could answer this!
|
|
|
|
|
OK here goes
All below code is on the same page
Ive declared this at the start of the class:
ArrayList arrayitemdesc = new ArrayList();
//This code is running on the button event, basically a listbox is displayed, a user chooses some options and then clicks this button. The loop below records all the selected rows in a session.
for (int i = 0; i < listbox1.Items.Count; i++)
{
if (listbox1.Items[i].Selected == true)
{
Session["itemsdesc"] += listbox1.Items[i].Text + " ";
Session["itemscode"] += listbox1.Items[i].Value + " ";
arrayitemdesc.Add(listbox1.Items[i].Value);
}
}
//this code runs when they click the button to add the selected items into the database. For each selected item in the array the stored procedure should fire, however it isnt.
for (int i = 0; i < arrayitemdesc.Count; i++)
{
SqlCommand cmdinsertliftunion = new SqlCommand("INSERT INTO unions (union_code, item_code)
VALUES ('" + new_adb_ref + "', '" + arrayitemdesc[i].ToString() + "')", con);
cmdinsertliftunion.ExecuteNonQuery();
}
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Solved it.
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
|
|
|
|
|
Good, was there any need to downvote my responses?
|
|
|
|
|
Wow! I didnt downvote your responses.If I was annoyed I would have voted your other response down about starting with a basic tutorial!
<edit> Just seen that post has been downvoted too, still it wasnt me!
<edit> And Now you have deleted the message, very mature
Deliver yesterday, code today, think tomorrow.
"http://www.heuse.com/cphumor.htm"
modified on Tuesday, October 7, 2008 10:30 AM
|
|
|
|
|
Hi All
I want to have a dynamically generated menu from a dynamically generated web.sitemap file which gets populated from the database. Is it possible.
Your help is greatly appreciated.
Thanks
Ansari
|
|
|
|
|
Hope This will help you
Check It[^] and
This[^]
cheers,
Abhijit
Think Sharp | Code Sharp | C Sharp
|
|
|
|
|
Hi Everyone,
How to check a paypal's email id verified or not programatically? Does paypal give any option for that? Any answers or links welcome.
Thanks
Jegastar D.
|
|
|
|
|
|
Hi All,
I have a requirement of writing an application for sending SMS for free. If anybody know how to send free sms using .Net or VB Script please let me know. I have tried with WebMatrix webservice but its not working. Any ideas about free webservices provided for free sms?
Thanks in Advance
Shahtech
|
|
|
|
|
Good luck mate! I think the era of sending sms messages for free is passed...
|
|
|
|