I currently have a web form aspx page that calls RegisterClientScriptBlock. This sends down message text that I use for client side validation e.g.
<script type="text/javascript">
//<![CDATA[
var c_errorMessages = {
RequiredField : "* Mandatory field"
};
//]]>
</script>
The values are generated on the s...
I need to dynamically build a list of textboxes using javascript and jquery. The problem I am having is when the textboxes are posted how do I capture the information in the controller.
...
I am trying to get my URLs in files/id format. I am guessing I should have two Index methods in my controller, one with a parameter and one with not. But I get this error message in browser below.
Anyway here is my controller methods:
public ActionResult Index()
{
return Content("Index ");
}
//
...
I have a 3 layer design. (UI / BLL / DAL)
UI = ASP.NET MVC
In my view I have collection of products for a category.
Example: Product 1, Product 2 etc..
A user able to select or remove (by selecting check box) product’s from the view, finally save as a collection when user submit these changes.
With this 3 layer design how this produc...
I have the following mapping for my table in MySql:
<class name="Tag, namespace" table="tags" >
<id name="id" type="Int32" unsaved-value="0">
<generator class="native"></generator>
</id>
<property name="name" type="String" not-null="true"></property>
<component name="record_dates" class="DateMetaData, namespace" >
<property n...
Hey guys
Just wondering if anyone has any idea how you can determine how many bytes of a request have been read/received by the server... In other words how do I stream http request...
In that, users are uploading files and I want to report on a perotic basis how many bytes have been read/received so far.
Just wondering if anyone ha...
Just moved from WebForms to MVC and replacing various userinterfaces. Not sure how the WebForms CheckListBox is implemented, is there a jQuery plugin or a basic example of this somewhere?
...
i want to create a external dll to store my .resx files.
i want to do this because i need to access this files from both presentation and business layers.
I have created a external project that contains the default and the es-Es resx files. i have mark it as PublicResXFileCodeGenerator to be able to access it from another dll.
on my v...
i am trying to refresh a autocomplete combobox coming from jquery ui as i am getting a new list via ajax.
the combobox looks fine on startup but when i refresh the combobox via jquery / ajax, it turns it back into a normal combobox
here is the jquery code:
$.get('/Tracker/RefreshList', function(data1) {
$('div#exercises'...
Hi, I am facing problem in creating an mvc application as sub-application of the asp.net application. My Mvc application is doing fine in development environment and even when it is deployed normally. However whenever I tried to deploy it as a sub-application of an asp.net application like http://mainapplication/mvcsubapplication I got a...
I've run into a problem setting up Selenium tests for an ASP.NET MVC project in cases where I need the settings provided in the web.config of the site under test. The problem is that I want to create a dummy user before running the test and this causes an error saying that the password-answer supplied is invalid. This is due to the test ...
[Authorize] property is nice and handy MS invention, and I hope it can solve the issues I have now
To be more specific:
When current client isn't authenticated - [Authorize] redirects from secured action to logon page and after logon was successfull - brings user back, this is good.
But when current cilent already authenticated but no...
My current setup:
I have an entity object with some properties, among them an int Id. To communicate with the database, I've created a repository with, among others, the following method:
public int Add(TEntity entity)
{
ObjectSet.AddObject(entity);
return entity.Id;
}
(It's a generic repository, that requires that TEntity is ...
I have a unique scenario where I want a base controller to grab some data and store it in a list. The list should be accessible from my views just as ViewData is. I will be using this list on every page and would like a cleaner solution than just shoving it in the ViewDataDictionary.
After attempting to come up with a solution, I though...
We have a cookie management library that writes a cookie containing some sensitive information, encrypted with Rijndael. The cookie encrypts and decrypts fine in unit tests (using Moq), works fine for MVC web applications, but when called from an ASP.net 2.0 website, the cookie cannot be decrypted. "Padding is invalid and cannot be rem...
Hi all,
I am new to asp.net mvc, so please bear with me.
We have the following route dictionary setup.
routes.MapRoute(
"Default", // Route name
"{language}/{controller}/{action}/{id}", // URL with parameters
new { language = "en...
Hi, I'm seeing this code in a project and I wonder if it is safe to do:
(ASP.NET MVC 2.0)
class MyController
{
void ActionResult SomeAction()
{
System.Threading.Thread newThread = new System.Threading.Thread(AsyncFunc);
newThread.Start();
}
void AsyncFunc()
{
string someString = HttpContext.Request.UrlReferrer.Au...
I have my application designed with Repository pattern implemented and my code prepared for optional dependency injection in future, if we need to support another datastore.
I want to create a custom validation attribute for my content objects. This attribute should perform some kind of datastore lookup. For instance, I need my content ...
Given a method..
public ActionResult Method()
{
// program logic
if(condition)
{
// external library
// external library returns an ActionResult
}
return View(viewname);
}
I cannot control the return type or method of the external library. I want to catch its results and handle that in a dialog on the page - but I...
I use declarative roles in my MVC.NET controllers and I have a custom membership & roles provider.
This works fine:
[Authorize(Roles = "ADMIN")]
Also, I have a base MVC.NET CustomController class that all controllers derive from, and it has a "currentUser" property that is auto-fetched from the session on demand, so all controller c...