can i add string builder object to a dictionary object? If yes code it. I mean i have a dictionary in which i have already added a few (string, objects), and i have a string Builder which has few variable already added now i want that instead of passing 2 different object in a method i want to pass only one object so can i add string builder object to same method as well
I am new at json, I want to make jquery ajax call to a asp.net webmethod to get back simple JSON object using string builder
[WebMethod] public static string GetmyJSON() {
[Code]....
But My alert message showing undefined instead of Manas why, Where I am doing wrong isn't possible to return a json object using string builder ? if possible how to write it.
WHAT EXACTLY I WANT IS TO RETRIEVE DATA(may be from separate table) AND THEN DISPLAY THEM PUTTING SOME STYLE(font,color etc). Is retrieving from multiple table is possible in gridview ? I could use the DataReader, but how to display them in style(font,color etc)?
I am having doubt in whether to use string or string builder to append html elements like "div" and others in my page in mvc. Is there any other approach for this thing.
the problem is if i do this i get a js error of Error: syntax error Source Code: return ShowContextMenu(event, StringBuilder sb = new StringBuilder(); sb.AppendLine("<b Id='"); sb.AppendLine(assets_item.Id.ToString()); sb.AppendLine("' oncontextmenu='return ShowContextMenu(event, "); sb.AppendLine("ctl00_ContentPlaceHolder1_rptNav_ctl00_AssetsTreeControl_1_pnlAssetsContext"); sb.AppendLine(")'>"); sb.AppendLine(assets_item.Title); sb.AppendLine("</b>");
I try to use method post to pass variable to next page. I find out that i can use stringbuilder to crete html element and then have the variable i want to pass in hiddenfield and then post and redirect to second page.
execute stringbuilder immediatley after a button is click ?
I have a dropdownlist attached to a cell when edit is selected. I am using the following code to populate the drop down list with the value that is on the row.
dlBU.Items.FindByValue((e.Row.FindControl("lblBU") as Label).Text).Selected = true;
This works famously when I have a value in the cell. It fails when the cell has not yet been populated. Is there an if then clause that if the value of e.Row.findcontrol("lblBU") is null no default value?
<%@ Import Namespace="System.Data.SqlClient" %> <script runat="server" > Dim connStr As String = ConfigurationManager.ConnectionStrings("cc").ConnectionString.ToString dim db As New Data.SqlClient.SqlConnection(connStr)
why this error
Object reference not set to an instance of an object.
on VWD 2005 this code works fine, but on 2008 it says I haven't created an instance of the object. I want to convert the object connString (a connection string) into a string.
'This acceses the virtual directory web.config file for connection strings 'We have to convert the object to a connection string Dim rootWebConfig As System.Configuration.Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/VirtualDirec") Dim connString As System.Configuration.ConnectionStringSettings connString = rootWebConfig.ConnectionStrings.ConnectionStrings("ConnectString1") Dim strConnString As String = connString.ToString().......
public class Package { public Package() { name = ""; type = new List<Dictionary<string, string>>(); } public string name { get; set; } public List<Dictionary<string, string>> type { get; set; } } [code]...
How can I do this using XmlDocument?I want readability over performance, and I find XmlReader to be hard to read b/c you have to keep checking the node type.
I'm try to make a little blog application in ASP.NET MVC3 with C#.I have a BlogEntry Class and Comment Class.
public class BlogEntry { public int Id { get; set; } public string Title { get; set; } public string Body { get; set; } public List<Comment> Comments { get; set; } [code]...
I want to cast back my ListBox Item into my Business Object. Following is the code. ListBox Populate Code on Page Load...
if (!Page.IsPostBack) { SalesDBEntities ctx = new SalesDBEntities(); this.ListBox1.DataSource = ctx.SalesHistories; this.ListBox1.DataTextField = "Product"; this.ListBox1.DataValueField = "SaleID"; this.ListBox1.DataBind(); }
And here is
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e) { SalesHistory sh = new SalesHistory(); //sh = (SalesHistory)ListBox1.SelectedValue; Error Here. How it is possible TextBox1.Text = ListBox1.SelectedValue.ToString(); }