Sir, my question was bit different. i am trying to know how asp.net mvc engine understand now user need to redirect to login page? if login controller name would be different then how asp.net mvc understand it ? where this binding done in default project when we create a default project from IDE?
i believe there must be a place where we mention that login page should come if user is not signed in when access any protected resource.
When the form is submitted, all buttons on that form will have their disabled property set to false. But that won't actually accomplish anything; a button's name and value are only submitted with the form if you click on that button, and you can't click on a disabled button.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Quick intro, My name is Jason and recently a work colleague retired and had developed several ASPX websites of which I have been tasked to support.
My previous background of programming is around Delphi, Intersystems Cache and more recently C# but these websites that I'm now supporting are all written in VB.net, asp.net, aspx or whatever language it is called, as you have probably guessed by now I have never used Visual Studio or produced code that created aspx files.
Anyway as a newbie to this language I have run into a problem that you experts will have learnt in school
I have a webpage (student.aspx) that contains this snippet of code :
The OnChange event will run on the server, when the page posts back to the server. That normally only happens when you click a button; if you want it to happen as soon as your list changes, you'll need to set the AutoPostBack property of the list to True.
SELECT DISTINCT does not work the way I want.
SELECT DISTINCT works for the class column but not for name_event column
If "MyId"is e.g. CW and there are 4 lines there but name_event should only be 2 pcs, but it shows 4 pcs
It should be:
What am I doing wrong?
<pre> Dim MyDataAdapter AsNew SqlDataAdapter("SELECT DISTINCT class, nationality, name_event from statistics_results Where class = @class", MyConnection)
MyDataAdapter.SelectCommand.Parameters.Add(New SqlParameter("@class", SqlDbType.VarChar, 10))
MyDataAdapter.SelectCommand.Parameters("@class").Value = MyId
TryDim dt AsNew DataTable()
Dim natlist = dt.AsEnumerable().[Select](Function(r) r("nationality").ToString())
Dim natvalue AsString = String.Join("- ", natlist)
litNat.Text = natvalue
Dim eventlist = dt.AsEnumerable().[Select](Function(r) r("name_event").ToString())
Dim eventvalue AsString = String.Join("<br>", eventlist)
litEvent.Text = eventvalue
Catch exc As SqlException
Sorry I missed the data source, yes I use MS SQL server. Have tried the variants above but I get the wrong number of "name_event"
I get numbers according to how many rows there are in the selected class.
This is how it will be at a selected class. It should be 1 World Championships note 6
Tips on how to solve it?
DEU - FIN - FRA - NOR - POL - SWE
Having trouble importing competition results from Excel to MS SQL Server with Asp.Net. Worked well until I added milliseconds. They are lost on import. Anyone with good tips on what the problem is?
MS SQL server Data Type: time(7)
Excel formatting for time results (Swedish Excel): tt:mm:ss,0
MyCommand.Parameters.Add(New SqlParameter("@total", SqlDbType.Time, 7))
MyCommand.Parameters("@total").Value = Trim(rad("Total"))
Time in Excel: 00:26:32,4
In SQL server: 00:26:32
I lost the milliseconds.
Format 109 is like "Jun 17 2012 2:00:29:147PM", so obviously [Start Date] is varchar already before the convert.
I suspect that that problem is that Excel thinks that this is a datetime value, and that's why the milliseconds are lost in transport. Excel is not really the best venue for strict data-typing, but rather the drivers makes some guesswork. You could try to format the column as text, but I am not sure it would help.
I never use OPENROWSET/OPENDATASOURCE to read Excel files myself. For one-offs I save the file as a CSV and import it with BCP. For imports on regular basis, I would write a client program for the task. Many people would go for a soluton with Integration Services.
where in the lifecycle of an asp.net page do you load the data for a gridview?
In Page_Load (which runs twice and check on !IsPostback is needed), in Page_LoadComplete (runs once) or in Page_Prerender (runs once)
I see better/smoother working of the pages when loading in Page_Loadcomplete event. How are your experiences?
I use Page_Prerender to set properties of a GridView other than DataSource and DataBind.
In Word you can only store 2 bytes. That is why I use Writer.
Assuming you're using ASP.NET 4.5 or later, don't use any of the above. Instead, set the SelectMethod on the control to the name of a method in your code-behind which returns the data. The control will then take care of calling the method whenever necessary.