Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
252 views
Hi.

This is not really a Telerik issue but I have not been able to find a solution on standard asp.net forums etc etc, so I thought I'd give it a try here as there are lots of very knowledgeable folks here. I'm sure this has been seen many times and it would be useful to have the answer for a lot of development/hosted testing environments...

I'm in the middle of a longish development cycle and I want to be able to switch automatically between my local development system/database and my hosted live/test system & database within code. Currently I have two web.config files and I'm alternating between the two. One on my local server and the other in my hosted environment. Unfortunately, this means that if I have to make a change within my web.config file I have to remember to do it for both files. I'm using the standard microsoft asp.net membership provider for login etc.

I'm using VS2008. This is an asp.net development and I'm a C# person. I'm using latest Q3 Telerik asp.net ajax controls. I'm using a SQL Server 2005 database server which contains my application database tables as well as the standard AspNetSqlMembershipProvider tables. I also have a hosted live system where I copy all my code etc, as well as a hosted instance of my database (app & standard AspNetSqlMembershipProvider tables).

I want to be able to programmatically  set the correct connectionstring for my app depending on whether I'm running locally in a dev environment or whether I'm running on the live hosted server so I don't have to maintain two different web.config files - I can just use one and my application will work out which database to use. I have to do it for both my main data access and the membership provider. I've worked out how to do it for my main app database. I'm using LinqToSql and I have generated a partial class for my datacontext which sets the correct connectionstring.  In my web.config file I have two connectionstrings - one for my live servers and one for my dev environment. 


Here's my connection strings in web.config.

        <add name="realtracproConnectionStringLive" connectionString="Data Source=72.18.156.252,1533;  Initial Catalog=realtracpro;Persist Security Info=True;User ID=realtracpro;Password=xxxxxx" providerName="System.Data.SqlClient"/> 
        <add name="realtracproConnectionStringDev" connectionString="Data Source=STEVE-IBM;Initial Catalog=realtracpro;Persist Security Info=True;User ID=realmaxcrm;Password=xxxxxx" providerName="System.Data.SqlClient"/> 
 

My code looks like this:

partial class MyDataContext 
    partial void OnCreated() 
    [ 
        ConnectionStringSettings connectionString = ConfigurationManager.ConnectionStrings["MyConnectionStringLive"]; 
         
        switch (HttpContext.Current.Server.MachineName) 
        [ 
            case "DEV-SERVER"
                connectionString = ConfigurationManager.ConnectionStrings["MyConnectionStringDev"]; 
                break
 
            case "DB-SERVER"
                connectionString = ConfigurationManager.ConnectionStrings["MyConnectionStringDev"]; 
                break
        ] 
 
        if (connectionString != null) Connection.ConnectionString = connectionString.ConnectionString; 
    ] 
 

However, I cannot work out how to do it for the membership provider stuff (I'm using the standard membership provider, I just want to point it at the correct DB through the connection string depending on if I'm running on my dev system or if I'm hosted in my live environment). Here's the web.config for the membership provider item. This is what I use in web.config for my development system. The web.config on my hosted server points to the live connection string.

<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="realtracproConnectionStringDev" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" applicationName="/"/> 
 

Any ideas on how to automatically select the correct connection string for the standard membership provider through c# code?


Thanks, Steve
Steve Y
Top achievements
Rank 2
 answered on 19 May 2009
1 answer
86 views
We are using a rad Calendar control in an ASP.NET website and had a user indicate that they could not select a date from the calendar when using Opera browser. We were able to confirm this by using Opera. Is there a compatibility problem or a something we need to do to get it working?
Daniel
Telerik team
 answered on 19 May 2009
2 answers
83 views
Hi, I´m using a radmenu on a master page and it works good to navigate on the site, but when I open a page with a radwindow with the modal option activated, the menu still appears and stay in front of the page I opened, so I don´t like that, somebody can help me to send the radmenu behind my page? THks.
jesus
Top achievements
Rank 1
 answered on 19 May 2009
3 answers
163 views
I'm using RadSkinManager in the format below to allow the user to change the site skin.

<

telerik:RadSkinManager ID="RadSkinManager1" runat="server" PersistenceMode="Cookie" PersistenceKey="myOnlineSkin"></telerik:RadSkinManager>

I can change the skin on all controls apart from the background colour of the RadTreeView control. The 'Black' skin stands out since the background should be back but i get my website background colour. I'm using release Q1 2009.

I'd be grateful for your comments.

Kind regards
Andrew

 

 

Yana
Telerik team
 answered on 19 May 2009
4 answers
144 views
I just installed 2009 Q1 and now most of my Design-Time controls do not render and display an error message as follows:

An unhandled exception has occurred.
Could not load file or assembly 'Telerik.Web.UI, Version 2009.1.402.35, Culture=neutral,...

I have added a reference in my Bin directory for the new Telerik.Web.UI.dll and the controls will render in Runtime, at least the ones I have tested.


ClarkSRoberts
Top achievements
Rank 1
 answered on 19 May 2009
3 answers
90 views
We are using Telerik 2008 Q3. We have a page that is almost entirely inside of a RadAjaxPanel and we are using a RadScriptManager and RadStyleSheetManager in the master page.

For some reason, and this doesn't happen for everyone, when they load up the page and click on something inside of the RadAjaxPanel, they get an immediate "Access is Denied" javascript error.

I ran debugging on it and found that it is this line
g=e.screenLeft-top.screenLeft-top.document.documentElement.scrollLeft+2


which was in the MicrosoftAjax.js file.

I don't entirely understand what is causing this. I don't get it on my local machine or even on our test server, but I can replicate it using a PC with a fresh install of Windows XP with SP2 and IE6 against our production environment. I've found items from Microsoft suggesting that it is because of an iframe and they suggest hacking the framework to get fixed. However, we don't have any iframe on this page, and I was unable to find any when viewing the source.

Thanks,

Adam

Adam
Top achievements
Rank 1
 answered on 19 May 2009
0 answers
85 views
hi
i am using latest version of telerik
my page is RTL :     <div dir="rtl">
when i am using in LTR mode , when make my rad menu with 100% width, every thing in OK(full horizon menu)
but when i make my page in RTL , the menu shows in minimum size(not full)
-------------------------------------------
<form id="form1" runat="server">
    <div dir="rtl">
        <table style="width: 100%;">
            <tr>
                <td>
                </td>
                <td width="300">
                    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
                </td>
                <td>
                </td>
            </tr>
            <tr dir="rtl">
                <td>
                </td>
                <td dir="rtl" style="text-align: right">
                    <div style="direction: rtl; width: 100%;">
                        <telerik:RadMenu ID="RadMenu1" runat="server" Skin="Office2007" Width="100%" Font-Names="Tahoma" Font-Size="8pt" Style="top: 0px; width: 1194px" EnableTheming="True" ExpandDelay="1">
                            <Items>
                                <telerik:RadMenuItem runat="server" Text="dddd">
                                    <Items>
                                        <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 1">
                                        </telerik:RadMenuItem>
                                        <telerik:RadMenuItem runat="server" Text="Child RadMenuItem 5">
                                        </telerik:RadMenuItem>
                                    </Items>
                                </telerik:RadMenuItem>
                            </Items>
                        </telerik:RadMenu>
                    </div>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </td>
                </asp:ContentPlaceHolder><td>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
    </div>
    </form>

plz help
ehsan
Top achievements
Rank 1
 asked on 19 May 2009
0 answers
117 views
Hi,
I m having a radgrid with first column is bound column and some template columns. I have merged the grid, Its merging the bound columns correctly if previous item & current item are same,in same merge code i am making template column rowspan incrementing by 1 by disabling the controls in template column.Now Template column is merging and controls are also disabling but extra columns are repeating based on merge of previous column (Extra borderlines is appearing after applying custom skin  for radgrid).

Ex:

Before Merging
Boundcolumn    TemplateColumn
901                     label,textbox
901                    label,textbox

After Merging I m getting like

BoundColumn    TemplateColumn
901                    Label,textbox            extracolumnborder lines

Note:
  • Extra column border lines are appearing after applying custom skin for grid.

 

Give me any suggestions or sample code to solve the above problem..


Thanks & Regards,
Siva Prasad 
siva
Top achievements
Rank 1
 asked on 19 May 2009
1 answer
85 views
Hi

I have recenly upgraded my development environment to VS2008/IE7 - we had a big project we needed to get finished before upgrading - and the first thing I have noticed is that the spinning arrows on the loading panels no longer work. The loading panel is displayed, but it no longer spins.  Is this a known feature?

Cheers

Rob
Dimo
Telerik team
 answered on 19 May 2009
0 answers
104 views
Hi,

I am showing schedule data using RadSchedule from a SqlDataSource.
ResourceType is very usefull, but I have seen that it preloads all data. Since my resources tables can become very huge, is there a way to easily add an improvement to load resources with an on-demand behavior ?

Is it possible to add another ResourceType to allow more fields to be read ? (today, I can only have one field readable with Text property)

I know that both things can be done with more selective datasources (rewrite queries to only select shown data, including resource queries to select only shown resources) and more resource datasources (one for each field I want to read, ex: Appointement types, 1 datasource for type Name, 1 for ForeColor, 1 for css style...)

Thanks.
Dédé
Top achievements
Rank 1
 asked on 19 May 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?