|
What if I need to create a GridView with dynamic template columns based on the user preference or search conditions?
The controls values cannot be accessed in Page_Init event. Therefore you cannot create dynamic controls in Page_Init event based on the values entered in controls such as Textboxe.
Also in Page_Init, if the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
But during load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
Therefore, Page Load is also good place to create dynamic controls.
|
|
|
|
|
Hello abhijit,
Thank you for your input. Do you have any suggestions regarding tutorials or white papers on the page life cycle? I've read through this one click here , but the whole concept is still quite foreign to me. I believe that's why I'm running into this problem; because I cannot yet visualize the 'flow' of the page.
Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
|
|
|
|
|
Hello,
I have an ASP.NET website with a SQL backend. I am using the ASP.NET membership provider model. The site can only be accessed by correct username and password. The login credentials for the website and OWA are identical.
I would like to pass the website login credentials directly to OWA so that OWA can be accessed directly from the webiste without having to re-enter username and password.
I am not certain how to securely pass the website credentials to OWA. I would greatly appreciate any assistance that you can provide.
I am slightly new to ASP.NET. If you need any additional information please let me know.
Thank you in advance for your help.
Allison
|
|
|
|
|
AFAIK you can't. One, OWA is on a different domain and the security credential from your ASP.NET app would mean nothing to OWA. Second, OWA is webased access to Exchange which uses Active Directory. So again, the credentials from your forms based authentication in your web app have no meaning to OWA. The only possibility you have is implementing a Single Sign On (SSO) framework.
only two letters away from being an asset
|
|
|
|
|
No Mark its possible. Even I have done this SSO with my ASP.NET Application with OWA. In my web application where user authenticated from AD and there was an link for Email Box with other staff. When user click on that link, I have done the SSO to directly logged in and moved user to OWA Inbox.
Note : I have done SSO with Exchange Server 2007.
Thanks
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit Jana wrote: Even I have done this SSO
Notice in my response "The only possibility you have is implementing a Single Sign On (SSO) framework."
only two letters away from being an asset
|
|
|
|
|
ahayw01 wrote: I would like to pass the website login credentials directly to OWA so that OWA can be accessed directly from the webiste without having to re-enter username and password.
You can do this !
Please let me know the following things,
1. Which version of Exchange Server you are using ? If it is 2007 then I can tell you what are the files need to modifed for SSO. There are only few JS that you need to modifed
2. Does all the used in same domain ?
3. Are you sure AD Password and SQL Server Password are same ? I am little bit confused over here, How any one can maintin the user authentication from AD as well as SQL Server also ? If AD is there, then used AD to authenticate the user for your appliction.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
I'm very interested on this topic.
Can you send me all info you can give me about SSO on owa 2007?
thank you very much
|
|
|
|
|
I am new to stored procedures. I want to know how to retrieve string values from stored procedures.
Like i created a website in which when user clicks a particular artists image then it's file location is
picked up from sql server. But im not getting way to retrieve from there through procedures.
-----stored procedure-------
create procedure arts
(@Artist nchar(50))
AS
return
(SELECT ret = Location from Artist_loc
where Artist = @Artist
)
in aspx.cs page-----------
string Artist = Request.QueryString["art"];
SqlConnection cn = new SqlConnection(@"Data Source=BLACK_RHYMES-PC\MSSMLBIZ;Initial Catalog=Muzik;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "dbo.arts";
cmd.Parameters.Add("@Artist",SqlDbType.NChar,50).Value = Artist;
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = cn;
i got struck after this what lines should i add to retrieve results.....
*THNX*
|
|
|
|
|
Use Output parameter
Create procedure arts
@Artist nchar(50),
@Ret NVARCHAR(40) OUTPUT
BEGIN
...
...
SET @Ret = yourresult...
END
From code write
SqlParameter oparam = new SqlParameter("@Ret", SqlDbType.NVarchar, 50);
oparam.Direction=ParameterDirection.Output;
cmd.Parameters.Add(oparam);
cmd.ExecuteNonQuery();
Now you will find the return statement in oparam.value . .
|
|
|
|
|
Create procedure arts
@Artist nchar(50),
@Ret NVARCHAR(40) OUTPUT
begin
set @ret = select Location from Artist_loc
where Artist = @Artist
end
it's giving error incorrect syntax near keyword 'select'
|
|
|
|
|
greendragons wrote: set @ret = select Location from Artist_loc
where Artist = @Artist
It should be
Select TOP 1 @ret = Location from Artist_loc where Artist= @Artist
SET will only be used when you initialize variable like
SET @x = 10
Hope you got the difference between the two.
|
|
|
|
|
Sry...still giving incorrect syntax near keword select
|
|
|
|
|
The code he gave you is correct. I suggest you buy a book on SQL, and ask SQL questions in the SQL forums.
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.
|
|
|
|
|
have you done like this ?
Create procedure arts
@Artist nchar(50),
@Ret NVARCHAR(40) OUTPUT
AS
begin
Select TOP 1 @ret = Location from Artist_loc
where Artist = @Artist
end
|
|
|
|
|
Hi,
I have an asp.net application on the local server. I had to make some changes to the code so i copied the website to my personal system and made the changes. I had to include mysql ado.net connector, as some retrieval needed to be done from mysql database.
I installed mysql ado.net connector on my pc but haven't installed it on the server. Because of this , the asp.net site when deployed to server throws an error of an unrecognized assembly.
Though , the solution is to install ado.net connector on the server... but i want to know if there is another way in which i only copy the dll file and it works (as is the case with windows application where dlls reside in bin folder)...
Thanx in advance
|
|
|
|
|
I would expect that putting the dll in the bin directory is all you would need to do. Installing it probably puts it in the GAC, but I don't know why that would be necessary.
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,
I currently host a site with Godaddy. I use a wildcard SSL. I recently added a sub-domain under the director "intranet". I cannot get it to work. According to godaddy the issue is with my configuration files. They say all subdomains must run in medium trust. I modified my config files correctly - I think .. but it still does not work. I think the issue is with godaddy.
here is my root config.web file:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<compilation debug="true">
<assemblies>
<add assembly="MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/></assemblies></compilation>
<authentication mode="Windows"/>
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
</system.web>
<location allowOverride="true" path="intranet">
<system.web>
<trust level="Medium" originUrl="" />
</system.web>
</location>
<system.net>
</system.net>
<system.webServer>
<httpProtocol>
<customHeaders>
<clear/>
<add name="X-UA-Compatible" value="IE=EmulateIE7"/>
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
here is my intranet config.web file:
<?xml version="1.0"?>
<configuration>
<appSettings/>
<system.web>
<trust level="Medium" originUrl="" />
<httpHandlers>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<compilation debug="true">
<assemblies>
<add assembly="MySql.Data, Version=5.2.3.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
</assemblies>
</compilation>
<authentication mode="Forms"/>
<customErrors mode="Off">
</customErrors>
<httpRuntime useFullyQualifiedRedirectUrl="true"/>
</system.web>
</configuration>
|
|
|
|
|
Might then be that your dll cannot run in a partial trust environment
(you'll need to recompile the dll to allow partially trusted callers)
Have a look at this[^] post
|
|
|
|
|
Do you agree that my config files are correct?
|
|
|
|
|
It does look correct, cannot see anything wrong...
|
|
|
|
|
I'm trying to deploy a new webpage and keep getting the following error:
The type or namespace name 'SilverlightControls' does not exist in the namespace 'System.Web.UI'
The error is complaining about SilverlightControls yet I'm not using any Silverlight at all. There is no reference to Silverlight anywhere in my page. This error occurs when I deploy the page to the server and try to run it from there. I've currently trimmed my example back to a single page with a single asp:Button on it and I'm still getting the error.
My best guess is that it's a reference issue but no amount of clean building or profanity seems to clear it up.
Anyone run into this before or know what's going on?
I'm about to try relocating the server to the parking lot by way of the roof.
EDIT: And Poof. The error disappeared as mysteriously as it appeared. I still don't know what happened/changed but it's working now.
|
|
|
|
|
thrakazog wrote: I'm about to try relocating the server to the parking lot by way of the roof.
ROTFL !!!
Is it possible that your web.config is referencing silverlight, for some reason, and then it's not installed on the server, hence the error ?
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.
|
|
|
|
|
I've gutted the everything from the web.config at this point. The server already hosts a couple Silverlight pages so if I was trying to use Silverlight it should have all the files it needs. But at this point I'm basically down to a "hello world" page and the error remains.
When I look at the Compilation Source for the error it contains:
Line 43:
Line 44: #line 18 "D:\PPL\PPLTest.aspx"
Line 45: using System.Web.UI.SilverlightControls;
Line 46:
This using statement line just doesn't exist in any of the code I wrote. The server seems to be creating it out of thin air and then complaining about it.
web.config
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings/>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true">
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
</system.web>
</configuration>
|
|
|
|