Here's my dilemma. I want all the goodness of controllers, I want strongly typed views and model binding - basically all the best bits of MVC. However, even a fairly simple page will usually require some client side script for showing\hiding elements, confirmation boxes & all that funky stuff that users expect for todays interactive web pages. You normally end up with 'page specific script' which will be a number of event handlers and bindings, with no real structure as such.
Backbone, Knockout and many of the other frameworks mentioned in the article I linked address this problem, they allow you to create client side models and bring structure and cohesion to your client script. However, the way they are designed almost relegates MVC to a simple 'web API' to handle RESTful requests and respond with some JSON. You seem to end up moving logic that I believe should be in the 'server side controller' into a 'script controller', which I'm not really happy with.
I want a structured script representation of my Model, that wires up all by event handlers for my View and keeps everything in a logical order. But I still want model binding, data annotations, validation and logic in my controller, everything that should be handled by MVC.Net. I want the best of both in other words
I've read quite a bit on this subject, so I know there are many different options available to me - that's the very point of the link. I'm just interested how others developing in MVC are addressing this problem?
I have a textbox with multiline, i want to implement a feature in which i click a hyperlink or button then the whole content or selected content of textbox get copy to the clipboard.
Thanks In Advance,Appreciates your help
Hi all, I am trying to create textboxes dynamically and I came across a method that does mostly what I want while searching for a solution on line. The method below is what I've found
for(int i = 0; i<boxes; i++)
TextBox tb = new TextBox();
tb.Location = new System.Drawing.Point(40, 120 + i * 20);
tb.Name = "TextBoxName" + i.ToString();
tb.Size = new System.Drawing.Size(184,20);
tb.TabIndex = i + 2;
tb.Text = String.Empty;
The problem with the above code snippet is that sending values placed inside of the created textboxes to a database is difficult because the textboxes all have the same name. If each textbox can be given a different name when it is created, it will be great. Any suggestion is greatly appreciated, thanks in advance
Would you please explain how all textboxes have same name. The loop clearly says that every textbox created has index associated with its name. First textbox name reads "TextBoxName1", second reads "TextBoxName2" and so on. Where is the issue you are facing?
The problem u have is how to access the dynamically created textboxes, isn't it
look, the code u had written actually creates a number of objects of type TextBox, and give every one a name that is 'TextBoxName1', 'TextBoxName2',.. etc
the problem here is how to access the objects created.
so, you must declare a generic dictionary of string and TextBox on the class level, means
Dictionary<string,TextBox> AllTextBoxes = new
this code will be in the class level not inside any methods.
the second step is to add a line inside the loop to add items to this dictionary, each of them consists of a key and a value, the key is the name of textbox, while the value is the textbox object created in each loop, this line will be at the end of loop,
For starter I don't think that code you posted above is for asp.net. html TextBox control don't have size and location properties (this is controlled by css class and some css styles). Second, don't you think that placing in a loop with "i" index and appending this index name, give each text box unique name?
<ScriptService()> _ <WebService(Namespace:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class WebService Inherits System.Web.Services.WebService Dim con As New dbConnection Dim da As OleDbDataAdapter Dim tempDT As New DataTable Dim SQL As String Dim rows, i As Integer Dim DepNames As New List(Of String)
<WebMethod()> _ Public Function getDepartementName(ByVal prefixText As String) As String() Try con.connect() SQL = "select DEPARTMENT_NAME from TBLDEPARTMENT_1 where upper(DEPARTMENT_NAME) like upper('%" & prefixText & "%')" da = New OleDbDataAdapter(SQL, con.con) da.Fill(tempDT) rows = tempDT.Rows.Count If rows > 0 Then For i = 0 To rows - 1 DepNames.Add(tempDT.Rows(i)(0)) Next End If Return DepNames.ToArray() Catch ex As Exception Throw ex End Try End Function
this webservice is works with ajax autocomplete extender but not with jquery this not gives any error and not call webservice method.
I have a textbox with multiline where one can write source code and compile & run it,my requirement is to implement line number like(1,2,3...) in each new line of textbox like program editor.....Thanks & Appreciates for your reply.
A simple hack is to put a listbox to the left of the textbox and display line numbers as items in the list box. Then you change the borders of the list box and the text box to make them appear as a single control.
I am new to WCF, but I like to have them in my production project instead of web services because of greater flexibiltity of WCF.
I have this scenario: One WCF that serve 9 client of the same application (on 9 different servers). The WCF build a Barcode ad return a PNG image.
I think that the better configuration is Single instance / Multiple concurrency. I also use Async methods to reduce latency.
Note that the client instance is a singleton shared between users on the same server, maybe a check on channel status is necessary?
Actually I am a little confused reading articles on WCF: some don't talk about Channel state, factory etc. Others articles show checks on channel state and Channel factory everywhere... What I have to do to make this thing work?
NOTE: using framework 3.5
Last Visit: 31-Dec-99 19:00 Last Update: 5-Mar-15 9:45