i have sp in sql server 2000 naed as get_job_by_jobType and it execute as returning table rows and get thedata in sql datasouce and i want to bind it on gridview,and i m executing storedprocedure on the basis of selectitem from dropdownlist.please tell me hwo to write code in code behind
Code:
Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Response.Write(DropDownList1.SelectedItem.Text)
' Me.GridView1.DataSource = DataSourceID
Me.GridView1.DataSourceID = Me.SqlDataSource4.ToString()
My application is working fine in local environment but not working after push code in live. My locale environment and hosting environment both are having same configuration. Same app working fine 2 month before but in different domain but same hosting server.
how to check the both config / any possible to run debug mode in hosting server please let me know. below code used in all page for checking user session status but when I click on any link page redirect to login.aspx I think session got timeout. I don't know why session got time frequently, but this issue not happening in local environment (desktop).
If Not IsDBNull(ext) Then ext = LCase(ext) End If Select Case ext 'Case ".htm", ".html" ' type = "text/HTML" 'Case ".txt" ' type = "text/plain" 'Case ".doc", ".rtf" ' type = "Application/msword" 'Case ".csv", ".xls" ' type = "Application/x-msexcel"........................
I mean, what is the faster way to get as fast as I can more than one table with stored procedure? Is there any study what is faster and why? There is a big problem getting more than one table at once with Entities, so the only way is DataSet. But I was told DataSet work very slow. Is that true?
Am trying to get a working enity model with foreign keys working but have run into a problem. I have imported 3 tables with content and some data.Lets call these tables geo_countries, geo_counties, geo_municipalities and the FK are:1. geo_county have a column country_id wich corresponds to country_id in geo_country 2. geo_municipality have a column county_id wich correspond to the county_id in geo_county.The problem i have is when i try to get correspondig child items with the following code i run into trouble:
[Code]....
The problem above is that 'test' generates results but not 'test2', wich never return anything. Am i not supposed to be able to do it like i do in 'test2'? I earlier tried to add a child object by replacing ToList() with Add() and that worked. But i cant seem to get anything out of it.
im explaining this base on a test page that i have hosted as i was trying to track down my problem, i have a hosted page which i have hosted on the internet on a hosting service provider. the page has a normal gridview that is linked to a SqlDataSource. and theSqlDataSource has sql statements for selecting data, updating and deleting. They all work fine locally and even if i host them locally through IIS. but on the hosting service they down work. only the select work, which means i can view my data on the gridview but i cant manipulate it, delete and updating dont wanna work, they dont do anything. and the worse part is that im not even getting an error from them, on the grid i have enabled the autogenerate edit button and the delete, how can i make the update and delete work, or what is it that makes them not to work. the code for my test page is below
Can the select command of a SqlDataSource be given by code in the code behind file. Also by calling the SqlDataSource.Select can the select statement be executed?
I want to bind an ObjectDataSource to a property in my asp page and I want to do it in the page's aspx code, not in code-behind. I've already done it in code-behind, as follows:
[Code]....
I'd prefer to get rid of the ugly code-behind and just do this in mark-up. Something like [Code]....
This gives me a run-time error: Cannot create an object of type 'System.Object' from its string representation 'SelectedBook' for the 'DataSource' property.Is there a way of doing this declaratively and not in code-behind? Further, what if what I want is to actually use a child property of the property in question? For example, if my Book object has a ReaderComments collection, can I databind to it decaratively in the aspx mark-up?
I wanted to disable a button after it is clicked and at the same time fire the post back event to generate a report. My first set of code did not work because soon after the button is disabled the page won't submit/post back. here's the first set of code which was not implemented. the onclientclick calls a javascript function which has these lines
its not working from client side alone after I disable the code behind attributes.add but when I check the view source the 2 pages are the samewhy am I not able to move the code from code-behind to design view?
Its regarding send mail via c#.net. The following code is working well in my local machine, upload it in server but its not working in server. I m using same smtp server name , email username , password in local and server. But i don't know what is problem? problem is in my coding?
<!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">
[code]....
no alert box is displayed when i left the textbox blank and clicked the button
Ok so I have my aspx pages. They work and display fine in IE, but dont do a think in FF. Perfect example is the home page, it has a large image that is set a url that is retrieved from my db in the code behind:
I've made a login page but I seem to have missed something and I guess I've become blind to the code because I can't find what's wrong with it. I'm sorry some of it's in swedish. There's no error message when I test the login, the program just stays on the login page.
Login page (aspx.cs): using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Text; using System.IO; public partial class Start : System.Web.UI.Page { string config = System.Configuration.ConfigurationManager.ConnectionStrings["InteraktivaFĂreningenConnectionString1"].ToString(); protected void Page_Load(object sender, EventArgs e) { this.TextBoxAnvändarnamn.Focus(); } protected void ButtonLoggaIn_Click(object sender, EventArgs e) //login-button { //kontroll av användarnamn och lĂsenord - controls username and password try { SqlConnection conn = new SqlConnection(config); { conn.Open(); string Användarnamn = this.TextBoxAnvändarnamn.Text; //username string LĂsenord = this.TextBoxLĂsenord.Text; //password string sql = "SELECT Login.anvandarnamn, Login.losenord, Medlem.ID FROM Login, Medlem WHERE anvandarnamn = '" + Användarnamn + "' AND '" + Session["användarnamn"] + "'"; SqlCommand comm = new SqlCommand(sql, conn); SqlDataReader dr = comm.ExecuteReader(); { try { dr.Read(); if (Convert.ToString(dr["anvandarnamn"]) == Användarnamn) //username { Session["användarnamn"] = TextBoxAnvändarnamn.Text; //username Session["medlemID"] = dr["medlemID"].ToString(); //memberID if (Convert.ToString(dr["losenord"]) == LĂsenord) { HämtaID(); //getID Response.Redirect("MĂten.aspx"); } else { string scriptet = "<script>alert('LĂsenordet är felaktigt. Prova igen');</script>"; //wrong password ClientScript.RegisterStartupScript(scriptet.GetType(), "FelLĂsen", scriptet); TextBoxLĂsenord.Focus(); } } } catch (Exception) { string scriptet = "<script>alert('Användarnamnet är felaktigt. Prova igen.');</script>"; //wrong username ClientScript.RegisterStartupScript(scriptet.GetType(), "FelAnvändarnamn", scriptet); TextBoxAnvändarnamn.Focus(); } dr.Close(); conn.Close(); } } } catch (Exception) { } } //gets and creates session variables of username and memberID public void HämtaID() //getID { try { SqlConnection conn = new SqlConnection(config); { conn.Open(); string Användarnamn = this.TextBoxAnvändarnamn.Text; //username string sql = "SELECT fornamn, efternamn, ID FROM Medlem WHERE ID = '" + Session["medlemID"] + "'"; SqlCommand comm = new SqlCommand(sql, conn); SqlDataReader dr = comm.ExecuteReader(); { while (dr.Read()) { Session["medlemID"] = dr["medlemID"].ToString(); //memberID Session["användarnamn"] = dr["fornamn"].ToString() + " " + dr["efternamn"].ToString(); //username } } dr.Close(); conn.Close(); } } catch (Exception) { } } }
Below is some code. The save() method was pre-existing. I added the saveRanking() method. When I walk through the code, it hits the method, but then it just bails out of it. No exception (that I can see). Do I need that function(data) part? Code: function save() { $.post( "/Applications/SaveStatus", [code]....
i am added one button on user control it is working fine locally but not working on server my error is CS1061: 'ASP.templates_categories_productsingrid_ascx' does not contain a definition for 'dl_viewall' and no extension method 'dl_viewall' accepting a first argument of type 'ASP.templates_categories_productsingrid_ascx' could be found (are you missing a using directive or an assembly reference?)
I've a very complete site in ASP.NET wich uses iframes. I'm working to change an old control we'd been using to show dialogs to use jQuery UI dialogs. I'm also making sure everything works well in IE9.
The fact is: the script I've in the pages shown in iframes is not working in IE9. Why? Because Object, Array and String are undefined. There may be some others issues, I've seen only this ones.
There is no chance (because a lot of reasons) to stop using iframes on some dialogs. And I'd rather not to use the meta tag to force IE8 Compability. Does anyone know any way to fix this uggly bug in IE9?
Edit
Here there's some info that may be helfull:
jQuery code for the iframe in a plugin I've made to config jQuery UI dialog:
This is from a very good book by Steven SandersonI am trying to follow the chapter 4 and trying to setup IOC on my mvc code from the code sample of the book but its not working.I follow the code from page 97 to page 101 where I set up Inversion of Control and run the code but I get the following error. A dialog box opens trying to search the following file:
c:TeamCityuildAgentwork1ab5e0b25b145b19srcCastle.WindsorWindsorWindsorContainer.cs protected override IController GetControllerInstance( System.Web.Routing.RequestContext requestContext, Type controllerType) [code]...
I fired up my first asp.net 4 app put together with visual studio 2010 and IIS doesn't seem to compile my code behinds on the fly for some reason, I have to build the site manually.
How do I configure my app to compile code behinds on the fly? I looked around but I must be missing something. Never had this issue before.
This same code working fine with MVC 2 but not working in MVC 3 razor. Once page is loaded not loading menu from HTMLHelper called within Razor like below.
Hardcoded menu for testing which is not outputting on the page.