|
|
Hello there,
Is ther i can know whether or not the a button in a form submitted the form in the page load event of the page.
Any help would be greatly appreciated.
|
|
|
|
|
On the button's click event you can add code to set a flag that can be read after the postback.
|
|
|
|
|
I dont understand could you please give me an example
|
|
|
|
|
Hi..
Referring to a DropDownList which is populated by a table, is it possible to select a default option whenever it is bound. For instance.. if I bind the DDL with Forenames from a user table, will I be able to tell the DLL to have a certain Forename selected as a default??
Thanks
The Magnitude of flaws in Democracy at least equals that of Dictatorship, Communism and Monarchy.
|
|
|
|
|
There is a property for DropDownList like
ddl.selectedValue="value you want to select by default"
But always remember to use this property after you bind your DDL ie DropDownList.
Regards
Tayyab
Lets work it Out.........!
|
|
|
|
|
Thanks man,
I'll try it out
The Magnitude of flaws in Democracy at least equals that of Dictatorship, Communism and Monarchy.
|
|
|
|
|
It didn't work.
The following error was thrown out :
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: PM System
The dropdown is currently populated with 4 entries from a table. I simply did this..
.<br />
.<br />
.<br />
Me.ddlDropDownList.Databind()<br />
Me.ddlDropDownList.SelectedValue = "PM System"<br />
.<br />
.
The magnitude of flaws present in Democracy at least equals that of ones present in Dictatorship, Communism and Monarchy.
|
|
|
|
|
Is there anything like Try/Catch in ASP?
I have a database query that may call on non-existant objects (It's like this for a reason, trust me ) and I need for it to throw up an "Invalid Argument, Choose another query" message at the bottom of the query page if an error does occur.
This is a webpage based interface.
- Munty
|
|
|
|
|
Absolutely..
Try [some code]<br />
Catch e As [TypeOf]Exception {e.g. SqlException}<br />
Return 0<br />
End Try
Just look up online what type of exeptions will suit your situation.
|
|
|
|
|
|
You're Welcome
|
|
|
|
|
For my applications, I have always used "InProc" session state. But I want to understand how to build applications using StateServer and SQLServer.
Can anyone point me to a relevant resource that shows how to build applications using StateServer and SQLServer.
Thanks
|
|
|
|
|
InProc is for a single server. StateServer and SQLServer are used when the app is on a server farm.
http://www.codeproject.com/aspnet/ASPNETSession.asp
|
|
|
|
|
Thanks for the above link
According to the article, I need to run InstallSqlState.sql to use the SQLServer state. This script creates a new database in my SQL server. This is OK if I owned the SQL Server. However, i have a shared SQL server account, hosted by third party and therefore, I cannot create a DB myself.
This means that people who have hosted databases, they cannot use SQLServer state for their asp.net applications.
|
|
|
|
|
All asp.net 2.0 email messages are duplicated. I did not have this problem in asp or asp.net 1.0 Any ideas? (server 2003, iis6, smtp enabled and working fine for 2 years)
'create the mail message
Dim mail As New System.Net.Mail.MailMessage()
'set the addresses
mail.From = New System.Net.Mail.MailAddress("webmaster@blah.net")
mail.To.Add("yogi@blah.net")
'set the content
mail.Subject = "Online Request"
mail.Body = "testing"
'send the message
Dim smtp As New System.Net.Mail.SmtpClient("127.0.0.1")
Try
smtp.Send(mail)
Catch ex As Exception
Dim ex2 As Exception = ex
Dim errorMessage As String = String.Empty
While Not (ex2 Is Nothing)
errorMessage += ex2.ToString()
ex2 = ex2.InnerException
End While
Console.WriteLine(errorMessage)
End Try
|
|
|
|
|
In case someone else has the problem, I found the solution:
My control had an onclick event, and the sub called had this:
protected sub btnClick_Click(ByVal sender as object, ByVal e as EventArgs) Handles btnClick.Click
....blah email
End Sub
Removed the "Handles btnClick.Click" and everything works ducky now....
|
|
|
|
|
I am just start ASP.NET using Visual web developer 2006 Exp Edition. I make a simple database(MSAccess) application , localy its working fine when i upload this application on site found following error
The type specified in the TypeName property of ObjectDataSource 'ObjectDataSource1' could not be found.
====================
Fakhruddin
====================
|
|
|
|
|
Have you copied the db over along with the app?
Have you used absolute paths the the db, instead of a relative path ?
|
|
|
|
|
Hi everybody!
I work on asp.net mobile applications. I should create some kind of daily planner. The problem is in absolute positioning of controls. I'm creating each planned element like <div> in a asp Repeater. All that works fine until i have two items planned in a same time. Than i should create some kind of overlapping. So I have top and left coordinates, not just top.
The problem is, mobile IE cannot render divs that way, it simply moves second div down. Is there any way can avoid this? Or does anyone can give me exact specification what can and what cannot be done on IE mobile 5.0.
Thanks in advance,
Fedor
-- modified at 9:26 Wednesday 1st November, 2006
|
|
|
|
|
Nobody
OK, does anybody knows where can i BUY a powerful mobile web calendar control (like Mediachase, but to work on mobile IE 5 ??
Please...
Thanks in advance,
Fedor
|
|
|
|
|
I need a simple example of a general manager that can
access all pages and a division manager allowed to access
only his division's oriented page
Tzumer
|
|
|
|
|
|
I need this for a site i m to upgrade,
there is the admin folder and
an 'admin' user, now i need hierarchy
for the admin so i need to limit/allow
access to pages by the user the has
logged in
|
|
|
|
|
Check out MSDN for IsInRole:
Something like this:
modifiy the web.config as:
<authorization>
<allow roles="MyDomain\MYCOMPANY_ADMINISTRATORS">
And the Page_Load Code is:
protected void Page_Load(object sender, EventArgs e)
{
if (Context.User.IsInRole("MyDomain\\WMS_ADMINISTRATORS"))
{
Label1.Text = Context.User.Identity.Name + " is part of ROLE";
}
else
{
Label1.Text = Context.User.Identity.Name + " is NOT part of ROLE";
}
}
|
|
|
|