|
I'm not changing the text?? I'm calling that value for that dropdown from the database by using the Select statement.
|
|
|
|
|
Bootzilla33 wrote:
code.SelectedItem.Text = dr["code"].ToString();
That changes the text of the selected item. If you want to select a different item, use the SelectedValue property.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Would that fix my original issue of the validator message popping up even though there is something in the field when coming from a prior page? If that fixes it or you think it fixes it then I will try it.
|
|
|
|
|
Yes, I'm pretty sure that will fix it. Your current code is changing the text of the selected item, which probably doesn't have a value.
NB: You could have tried it for yourself and found the answer immediately, rather than waiting over the weekend for my "permission" to try it.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Getting error on bolded line, activitycode.Item(I),Value... if you can't see it.
private void cvactivitycode_ServerValidate(object source, ServerValidateEventArgs args)
{
args.IsValid = false;
for (short I = 1; (I
<= (activitycode.Items.Count - 1)); I++)
{
if (activitycode.Items(I).Value)
{
args.IsValid = true;
break;
}
}
}
What am I missing or need to fix.
|
|
|
|
|
Might not be the answer but you initialise I to 1 in the for loop, should it not be 0?
|
|
|
|
|
The error says you cannot use Items like a method. You used () instead of []. So, change Items(I) to Items[I]. You are not calling the method Items() you are accessing an item in the collection.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Seems like you are aware of VB.NET.
if (activitycode.Items(I).Value)
That is VB.NET way of accessing array elements, in C# that is used to invoke functions. What you need is like this,
if (activitycode.Items[I].Value)
This would work — provided no other errors are raised; is Value of bool type?. For more on this, you can just search for, "array indexing in c# vs vb.net", and also "how to call functions in c#" they will give you a good overview of these features.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I am new to javascript but definitely not new to asp.net development. I was wondering why javascript is gaining popularity among asp.net developers
and what functionalities or features within an asp.net web application it is most often used for ;And also I was wondering is there a particular javascript book that would help me to learn the capabilities of javascript when used with asp.net. Thanks
|
|
|
|
|
There are lots of Javascript books, as there are lots of books on any subject, and Google will find them for you. You can learn Javascript basics quite quickly at JavaScript Tutorial[^].
|
|
|
|
|
You should definitely start with this: JavaScript: The Good Parts[^]
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Patrick Rogers wrote: what functionalities or features within an asp.net web application it is most often used for For any time you do not want to have a full postback of your page. Which could be very often.
There are two kinds of people in the world: those who can extrapolate from incomplete data.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi all,
I need any example or sample application or link anything to develop an ASP.Net MVC Single Page Application using Type Script. Can I write a Single Page application at all using ASP.Net and Type Script, if I can, can somebody please give me an example or sample code etc to help me out. I am new ASP.Net MVC and front-end coding I am more into Middle tier and Back-end coding.
Thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
|
Even a preciser answer than what Richard gave, ASP.NET Single Page Application | The ASP.NET Site[^].
TypeScript is just a superset of JavaScript, you can use that too, if you know how to use it. If these don't fit for your application, you may also learn the basic SPA template and apply it: Single-page application - Wikipedia[^], basically application just should not reload, it can change the content as required and requested.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Can you provide me an example so that I can maybe reverse Engineer it for my need, I am really poor in MVC, still struggling to connect between front end control with Controller Action, if the application has calls to action methods specially page submits that will help me a lot.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
That is why, SPAs use a client-side framework, such as Knockout etc instead of server-side. You need to learn how to use, example, Knockout.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I want to pass the ACTIVITY_ID field (which is primary key) on an update statement where clause . I need help on how to do that. Here is Update Statement and parameters:
conn.ConnectionString = strConnection;
conn.Open();
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "UPDATE BUYING_ACTIVITY SET CUSTOMER_SOURCE_CODE = :custsrc, CUSTOMER_NAME =:name, CUSTOMER_CITY = :city, CUSTOMER_STATE = :state WHERE _ACTIVITY_ID = ?";
cmd.Parameters.Add(new OracleParameter(?));
cmd.Parameters.Add(new OracleParameter("custsrc", custsrc));
cmd.Parameters.Add(new OracleParameter("name", name));
cmd.Parameters.Add(new OracleParameter("city", city));
cmd.Parameters.Add(new OracleParameter("state", state));
cmd.ExecuteNonQuery();
conn.Close();
What value do I use to set = to ACTIVITY_ID on the WHERE clause is what I'm asking.
|
|
|
|
|
That is a Database question, nothing to do with ASP.NET.
|
|
|
|
|
You pass the value in the same way as the other parameters:
cmd.CommandText = "UPDATE BUYING_ACTIVITY SET CUSTOMER_SOURCE_CODE = :custsrc, CUSTOMER_NAME =:name, CUSTOMER_CITY = :city, CUSTOMER_STATE = :state WHERE _ACTIVITY_ID = :activity_id";
cmd.Parameters.Add(new OracleParameter("activity_id", activity_id));
cmd.Parameters.Add(new OracleParameter("custsrc", custsrc));
cmd.Parameters.Add(new OracleParameter("name", name));
cmd.Parameters.Add(new OracleParameter("city", city));
cmd.Parameters.Add(new OracleParameter("state", state));
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hi All,
I have an MVC application which when I run the application it goes to http://localhost:49626/login.aspx?ReturnUrl=%2fhome%2findex, I am not sure why it goes and searches for the Login.aspx url, I am new to MVC, any help is going to be very helpful, I even set as specific page as this: home/index, still it goes onto login.aspx page.
I am very poor with url, I have register routes as below:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Startup class as below
public class Startup
{
public void Configuration(IAppBuilder app)
{
}
}
I have area registration as below:
public class HelpPageAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "HelpPage";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"HelpPage_Default",
"Help/{action}/{apiId}",
new { controller = "Help", action = "Index", apiId = UrlParameter.Optional });
HelpPageConfig.Register(GlobalConfiguration.Configuration);
}
}
Any help is going to be very helpful for me as I am very poor in understanding the route mapping and configuration of ASP.Net MVC applications, any help a code snippet, a link or even suggestion would be very helpful, thanks in advance.
Thanks,
Abdul Aleem
"There is already enough hatred in the world lets spread love, compassion and affection."
|
|
|
|
|
Sounds like you've got Forms Authentication configured, but pointing to a WebForms login page.
Have a look in web.config , under system.web/authentication , particularly the loginUrl attribute on the forms element.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
i want to ask about the post by ashish chaudhary, in which we are suppose to fill the datagrid and then export it to excel file. I am using the same code, but i am getting the error in the given below line.
"string Path = "D:\\DataListWebsite\\myexcelfile_" + DateTime.Now.ToString() + "_" + DateTime.Now.Month.ToString() + ".xls";
All the code is as it is..... No issue . Please help....
|
|
|
|
|
Should the quote in front of string be there?
|
|
|
|
|
Why not ask ashish chaudhary (whoever he/she is)?
|
|
|
|