MVC :: Newbie Question: Still Seeing Server Controls?
Feb 11, 2010
I'm a complete newbie to MVC. I just started playing with it and to my surprise IntelliSense still offered my the familiar server controls e.g. GridView, Button, etc. I thought the idea w/ MVC was to have much tighter control on HTML rendered. Also, the Button server control still shows me OnClick. I thought MVC was not events driven.
View 10 Replies
Similar Messages:
May 4, 2010
In the Page_Load() event handler for one of my pages I use the new statement about 100 times equating to memory allocation for about 100 objects. As follows:
using System.Web.UI.WebControls;
Table mytable1 = new Table();
TableRow [] myrows = new TableRow[5];
TableCell [] mycells = new TableCell[100];
int i;
for(i=0; i<5; i++) myrows[i] = new TableRow();
for(i=0; i<100; i++) mycells[i] = new TableCell();
My question is, should all of these new statements be enclosed like so:
if(IsPostBack==false) {
// Initialize all controls for page just once during the session
}
Or should the Controls be freshly allocated, initialized, and added to the page each time the Page_Load event handler is called? I personally don't think its efficient to create mytable from scratch every Page_Load since all I really ever change is the contents of the table and not the table itself.
View 2 Replies
Jan 19, 2011
Code:
public class GroupInfo
{
private List<Structure> _sectors = new List<Structure>();
[XmlElement("Sector")]
public List<Structure> Sectors
{ get; set; }
[XmlElement("Person")]
public List<Users> Person
{ get; set; }
[code]...
View 10 Replies
May 4, 2010
I know almost nothing about coding in .NET and XML and web services.I need to call a web service and pass it a structured XML statement and catch the return from the web service.I have no idea where to start except I think I am suppose to create a new 2008 VB.NET ASP Web Service App. After that I have no clue. Here is a copy of the bindingattribute I think I need but do not know how to use it: (I think it is correct)
<WebServiceBindingAttribute(Name:="TestConnection", _
Namespace:="http://www.exchangenetwork.net/schema/header/2", _
Location:="https://naas.epacdxnode.net/xml/securityToken_v30.wsdl")>
I also have the xml statement I want to test with. I need to send it and recieve the response. I am pretty sure the web service is using SOAP and I know the XML will have to be wrapped in a SOAp wrapper but I have been told .NET will do that for me.
View 2 Replies
Jul 1, 2010
I'm all set up with Visual Developer 2010 Express and successfully (yaaah) worked my way through the NerdDinner tutorial (thank you, thank you, thank you!). So, I think I have everything set up correctly so far. I used the "Install Everything" without the prebuilt apps and all went smoothly.
However, my goal is to set up CMS for a small company owned by a relative so they can update their website as necessary. I'd love to do this with MVC.
I have tried to install both N2 CMS and Umbraco, but can't get past the admin and user names and passwords for the database. Since I'm failing with both apps, I think it's something about setting up the database server that I need to understand.Win 7 Home Premium 64, home system, not on a network. what I need to enter for admin / admin passwords and user / user passworks for N2 CMS and Umbraco?
View 2 Replies
Feb 28, 2011
I have a table where a primary key is a composite key build from columns: phone_nr and phone_ext.
How do you put a KeyAttribute in a Model in this case?
When a primary key is one column in a Model I coded:
[Key]
public string category_name { get; set; }
public string user_id { get; set; }
in the above case the column category_name is the primary key, but what to do when you have a composite primary key?
View 2 Replies
Jan 28, 2011
I'm trying to learn MVC and I'm playing around with the MvcMusicStore tutorial.I'm trying to modify the StoreController to change some of the behaviours.I'd like to change the route behaviour from:
[Code]....
View 5 Replies
Jan 25, 2011
I have controller method that looks something like this:
[Code]....
notice the commented out line. This method used to return an IEnumerable<Sport> but now that I have used a LINQ query it is returning an IEnumerable of an anonymous type (I think that's the correct terminology - please correct me if I'm wrong).
Question I have is...can I add a strongly-typed view based on this anonymous type and if not, how do I write a view that can access this collection?
View 3 Replies
Oct 10, 2010
As an ASP.NET newbie I'm trying to get an initial project going without laying out huge sums for advanced visual components. recommend any good open source control libraries for ASP.NET? Something that includes a table, tree, calendar, and the usual mix of input/display controls.
View 1 Replies
Sep 24, 2010
I thought I was coding a change event correctly, yet somehow i'm not getting any resultI made the simplest of examples to accomplish what i want
[Code]....
View 4 Replies
Feb 4, 2010
HOWTO create ASP.NET C# controls on server side for posted data that had no runat=server on the client.
I have processes needing to post files to a ASP.NET application. These processes must post without runat=server as such:
<form ~~~~ to some ASP.NET/C#/aspx page>
<input type=file name=MY_FILE ~~~>
</form>
On the ASP.NET page, in the Page_Load I would code somethign like this:
[URL]
Here is the trick, the control "fileLIST_FILE" does not exist because the HTML does not have runat=server on it.
If the client did have runat=server the designer.cs would have somethign liek this:
System.Web.UI.HtmlControls.HtmlInputFile fileLIST_FILE;
With all that said, I want to make "fileLIST_FILE" on the fly inside Page_Load fromt he posted name of "MY_FILE".
do not focus on the fact that this is a file upload. I would like to know how to do this for any posted FORM data.
View 11 Replies
Apr 15, 2010
How to insert data from local SQL server to remote SQL server (without using linked server) like below?
insert * into [remote server].[northwind].orders
from [local server].[northwind].orders
View 4 Replies
Feb 9, 2010
I have to programmatically import a table from a database "A" in Sql Server 2000 to a database "B" in another server 2005.
View 1 Replies
Apr 4, 2010
I have a custom server control inheriting from CompositeControl. It consists of two RadioButtonlist controls that are rendered side by side in an html table. The number of ListItems in each RadioButtonList is not known until runtime. Depending on how many items each list contains, the RepeatColumns property of each list is set differently. To do this in the handler for the ItemDataBound event I need to get the count of ListItems in each RadioButtonList. How do I expose the Items.Count property of each internal RadioButtonList as a top-level property? I tried using a getter to return the count but this generates a compile-time error to the effect that the count cannot be assigned to--even though I have not created a setter.
Similarly, in the handler for the Submit event, I need to get the ClientID of each internal RadioButtonList to pass to a method that checks for data changes. How do I expose the ClientID of each component RadioButtonList as a top-level property?
I can of course index the Controls collection of the composite control to access the child control and read its properties--but that defeats the whole point of making a complex, independent custom server control.
View 1 Replies
Sep 30, 2010
I have a server control which consists of a gridview with custom navigation&information capabilities and with javascript functions to highlight the selected grid items or highlight when mouse over event occurs.. (full tested outside asp:wizard)I'm trying to use that server control inside a template wizard step, when I drop such server control in the first step of the wizard everything goes ok.
When I insert even a blank step previous to the step which contains the server control, the javasript code of the server control is not rendered at all, the page doesn't fail during load but until I go with mouse over an item of the grid for instance.When I check the rendered HTML I can see no HTML, nor javascript events of this server control where rendered, neither the implementation nor calls to javascript, but even rarer what is there visible in the grid for ie, even the other components of the server control, are not in the "view source code" content. I seems it was sent to the client, even showed, but truncated in some phase..
View 1 Replies
Aug 20, 2010
according to what i read from web there 3 types of custom server controls
1. composite
2.superclass
3.rendered
i found video tutorial to create and use superclass custom control in your project (extending dropdown control functionality)
i am trying to search video tutorial for other 2 types .
View 1 Replies
Jun 17, 2010
Migrating SSIS package from SQL Server 2005 to SQL Server 2008
View 1 Replies
Feb 25, 2010
Previous developers have developed a .SSISDeploymentManifest file (SQL Server 2005) to install SSIS packages which prompts a Package Installation wizard. I tried to install it on SQL Sever 2008 (it works on SQL Server 2005), but it failed with the error: "Storing or modifying packages in SQL Server requires the SSIS runtime and database to be the same version. Storing packages in earlier versions is not supported".
How do I install 2005 SSIS packages on SQL Server 2008? I have all the .dtsx files, not sure how to install them?
View 2 Replies
Apr 2, 2010
I have 5 GB data, when I move from SQL server 2000 to 2008 with Import and Export wizard, my LDF size is increased to 30 GB, Can I reduce my LDF file or move. In my one of the table contain around 20 Lakh data which i have normalized in 2008 and create 4 tables, so my data is entering in normalized form in 2008. But due to size by hard disk is full. I have used shrnik command but it reduce to only 1 GB.
View 5 Replies
Jan 14, 2010
We have a cient we are stting up that has 2 separate physical servers, one that is the web server the other the database server. Using impersonation we have been able to get the website to connect and retrieve data from the sql server so that part is not an issue. The problem is I have a windows service application that must be installed on the web server (as it process files downloaded to an ftp site) and it must be able to connect and write to the sql server as well.We tried adding a system.web block with the impersonation stuff to the app.config file which of course did not work. Can anyone tell me what/how we need to configure this properly?
View 7 Replies
Mar 5, 2010
Not sure why it works if i connect to SQL 2005 on another server, but now that i have SQL Express on the same server as the pages, im getting the following error: I have attached my connection string within my web.config and also how its being called within the code behind. Now this page was written by another programmer some time back.. so not sure if the method he used to do this is the best or only way. But i have connected to other SQL database with other applications with alot less code.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.
(provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Source Error: Line 131:
Line 132: //connect to this sql server
Line 133: c.Open(); -----> this is the line it complains about.[Code]....
View 8 Replies
Sep 16, 2010
how to implement requiredfieldvalidtor. Server control which i have created does not work on client side. No javascript is been rendered and onSubmit the page.isvalid returns true.
[Code]....
View 3 Replies
Jul 8, 2010
how to transfer my data from devlopment server to production server ,i have already records exist in my database if i go for script then how can i transfor record in script i can transfor only table ,procedure and views.I am using SqlServer 2005.
View 2 Replies
Nov 4, 2010
I need to make an ajax call from my javascript and access a control on my page. Using a webmethod wont work then since it's static, do I have any other options?
View 3 Replies
Jul 1, 2010
How can convert DTS package from SQL Server 2000 to SQL Server 2005
View 2 Replies