|
But with checkboxes, for example, when you use ASP.NET (not mvc) you can manage them as if their were winforms checkboxes (ie. myCheckBox.Value is bool),
And with Listboxes, you can refer to the ith item in the list (because its an array), and so on..
|
|
|
|
|
Because ASP.NET converts it all for you. Which is why I said, it sounds like MVC sucks.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: Because ASP.NET converts it all for you. Which is why I said, it sounds like MVC sucks.
Seriously. MVC is like a step backwards. I haven't had any problems with ASP.Net, I don't understand what issues MVC fixed. Really, I don't get it even a little bit.
I didn't get any requirements for the signature
|
|
|
|
|
MVC solves the separation of concerns.. thats what it "fixes"
|
|
|
|
|
Christian Graus wrote: Which is why I said, it sounds like MVC sucks.
A broad statement that can fit any number of situations, tools, technologies, etc.
sounds like [insert name here] sucks.
only two letters away from being an asset
|
|
|
|
|
Well, I only have his description to go on, so that is what I was commenting on.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Christian Graus wrote: Sounds like MVC sucks.
Not in all aspects.
It is good if you want better testability, reduced payload, meaningful URLs and many other things. Two things which I don't like about ASP.NET MVC are, writing markup and server side code together like we did in old ASP and installations on IIS6. Installation on any IIS versions prior to 7 is not very straightforward.
|
|
|
|
|
Hi
I am building an asp.net web application using visual studio 2008 with .NET 3.5 on Windows XP 32 bit machine where I have the server as well. C# and javascript are used.
There is contactUs.aspx, once the form is submitted successfully, I want to run the jQuery in the contactUs.js file starting from line 20 (var dataString = 'name=' + name + '&email=' + email;) to line 40 (return false;).
How do I wire it up.
contactUs.aspx.cs
<pre>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class contactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
try
{
totalCareAutoTableAdapters.ContactUsTableAdapter ContactUsAdapter = new totalCareAutoTableAdapters.ContactUsTableAdapter();
int new_ContactUs = Convert.ToInt32(ContactUsAdapter.InsertContactUs(name.Text, mobileNumber.Text, emailAddr.Text, subjectTitle.Text, messege.Text));
}
catch (Exception ex)
{
}
}
}
</pre>
contactUs.js
<pre>
/// <reference path="jquery-1.3.2-vsdoc2.js" />
$(function()
{
$('.error').hide();
$(".button").click(function()
{
// validate and process form here
$('.error').hide();
var name = $("[id$='name']").val();
var email = $("[id$='emailAddr']").val();
if (name == "")
{
$("[id$='name_error']").show();
$("[id$='name']").focus();
return false;
}
var dataString = 'name=' + name + '&email=' + email;
$.ajax({
type: "POST",
url: "siteMap.aspx",
data: dataString,
success: function()
{
$("[id$='contact_form']").html("<div id='message'></div>");
$("[id$='message']").html("<h2>Contact Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>")
.hide()
.fadeIn(1500, function()
{
$("[id$='message']").append("<img id='checkmark' src='images/fiat.jpeg' />");
});
}
});
return false;
});
});
</pre>
|
|
|
|
|
Well, once postback has occured, your page will be rerendered, and the javascript will be able to run. If you need to run a specific method after a specific postback, inject a method call into the page so it runs when rendered.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
To begin with I AM NOT AN ASP.NET Coder. So please bear with me and my questions.
I have to build this in asp instead of silverlight so it can be accessed on blackberries.
I have a page that collects a ton of data about where a link will be started.
The engineers then construct 4-8 links to the endpoint terminus.
What I'm trying to do is have each link get added to the list of links until they click the done button.
Each 'link' in the list would be as follows:
lable'Leg ' lable'nn' text' ' button[next link] button[done]
the lable with the 'nn' value is populated by me and is 1, 2, 3, 4, etc.
the button with [next link] would trigger adding the next set of lables, textbox, and buttons.
the button with [done] would populate the database with all of the links.
In a prior post I was given invalid control types to use and the person never answered me after that.
So how would I do this in ASP.Net so that the input is always sent back to me and the next link is added to the list with each postback?
|
|
|
|
|
A few ways you could do it.
Use a repeater control with a template that contains the label the textbox controls
Pseudo code here
<repeater>
<template>
<label>
<textbox>
</template>
</repeater>
<button value=Next><button value=Done>
Bind the repeater to some collection. Handle the click event for the button and add an item to the collection, then rebind to the repeater.
Another way is to handle the click event for the button and add the next set of controls to the controls collection of the page.
only two letters away from being an asset
|
|
|
|
|
Mark,
Thank you so much. I have everything almost working.
After a little debugging I found I had to code a bit to rebuild the collection of values for each new connection added.
Now I have just a tiny issue I cannot figure out. My logic is quite simple:
protected void NextLegEventHandler( object sender, EventArgs e )
{
LegItem legItem = new LegItem( );
legNames = new Dictionary<int, LegItem>( );
foreach ( Control item in LegConstructor.Controls )
{
if ( !( item is RepeaterItem ) ) continue;
if ( item.Controls.Count <= 1 ) continue;
foreach ( Control textItem in item.Controls )
{
TextBox currentControl = textItem as TextBox;
if ( currentControl == null ) continue;
int result = 0;
if ( Int32.TryParse( currentControl.Text, out result ) )
{
legItem = new LegItem( );
legItem.LegNumber = result;
}
else
{
legItem.PortName = currentControl.Text;
legNames.Add( legItem.LegNumber, legItem );
}
}
}
LegItem newLeg = new LegItem( );
newLeg.LegNumber = legNames.Count + 1;
newLeg.PortName = string.Empty;
legNames.Add( newLeg.LegNumber, newLeg );
this.LegConstructor.DataSource = legNames.Values.ToArray<LegItem>( );
this.LegConstructor.DataBind( );
}
So this way I rebuild the values for each leg and rebind with the new list.
The problem: I have to hit the button twice to get the new entry to display! What am I missing to force the page to display the new data once I complete my response to the event?
Thanks again,
Michael
|
|
|
|
|
Why are you going through all of this
Maintain your collection (as in ViewState, Session, etc.), add one to it in the handler, then rebind. What is the dictionary for? You are only using the values from it.
Michael Eber wrote: I AM NOT AN ASP.NET Coder.
Whether you are an ASP.NET coder or not, someone with your professed skills and length of C# history should be able to figure this out. After writing a new multitasking operating system in Assembler this should be a walk in the park.
only two letters away from being an asset
|
|
|
|
|
Sorry but I'm accustomed to writing code that is stateful where I can just access the datasource, cast it, and append to it. Web coding is a completely different animal. Regardless of HOW I am doing it, whether I figure out how to use ViewState or if I figure out Session, it does not change the fact that when I set my datasource and rebind it, my controls are not displaying until I hit the button twice, or slowly walk through the code in debug mode. Why is this happening? In a real application (ie. not a freaking web p.o.s.) this is always easily figured out. But I cannot figure out why I must hit the button twice to see my control. You say just rebind it. Well I am rebinding the fracking array. And it is not doing it. If you have something USEFUL to add, please I'm all ears. But if you don't then thank you for at least getting me this far.
|
|
|
|
|
Oh yes...another reason for doing this is to get the responses in all of the textboxes.
Does that pass back in Viewstate as well?
I dug through two obvious routes (control and Page) but nothing is there to access ViewState.
|
|
|
|
|
|
Thank you for a usable answer. So it seems that the viewstate is updated prior to reaching my method ... that adds the new control. So it appears that for the webpage if I instantiate the viewstate update method after binding, then the control should show properly on the outbound process.
|
|
|
|
|
A true professional would have been able to research this for themself
only two letters away from being an asset
|
|
|
|
|
Ahhh yes, you are two letters short of an asset.
|
|
|
|
|
Hi,
We are using a .Net window service to create Customized Microsoft Project Plan 2000 through our application.
1)When the users trying to create the MPP , Windows service "WinserviceMPP.exe" is invoked to create it programatically.
2)" WinserviceMPP” windows service internally calls “Winproj.exe” to do the operations on the Microsoft Project Plan.
3)The process of Instantiation and stopping the above mentioned services will be done programmatically by the application.
4)In normal scenario the process is working fine and MPP can be generated without any issues.
5)But, in certain scenarios Creation of MPP is not happening properly.
6)When we verified in the Windows event Log, the error message is logged as “Failed to Stop Service”. These type of scenarios are coming continuously, and users are facing problems in creating the MPP.
7) When the system is failed to stopping the service, we are manually killing the service i.e stopping the service in task manager. As soon as we killed the service, MPP is creating with proper data. This means system is unable to stop the service.
8)These type of “Failed to stop service” errors coming randomly and when manually stopping the “Winproj.exe” service MPP is creating successfully.
|
|
|
|
|
I've read this three times and still can't see what it has to do with ASP.NET ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Christian Graus,
The front end application is developed in ASP.Net
|
|
|
|
|
Whether this problem is because of the windows 2003 server memory??? Becasue recently we installed symantec end point protection as Anti virus.
We are using the MPP creation through window service since 2004.Till then we didn't face this type of problem.
In one of the site i read that "It consumes a lot of memory and CPU resources - this is 'symantec end point protection' main disadvantage".So while stopping the windows service through program, becasue of insuffient memory-- system is not able to stop the process.Some times the stopping of the service is working absolutely well.
modified on Thursday, October 8, 2009 5:39 AM
|
|
|
|
|
hi;
i m a student of computer science i have assigned a project to develop a web site in asp.net and have the functionality of sending sms by using gsm modem but i dont know anything in this regard please give me a road map for this.
thanks
regards
m.hussain
|
|
|
|
|
muhammadhussain wrote: i dont know anything in this regard please give me a road map for this.
Start here[^].
|
|
|
|