C# - Picking A Server Control Depending On Environment?
Aug 4, 2010
I have an aspx page that references a server control from an assembly and lives in Sharepoint (knowledge/experience in Sharepoint is not required to answer this question, i'm simply giving you context). The implementation looks something like this:
<%@ Register TagPrefix="wc" Assembly="Test.Controls" Namespace="Test.Controls" %>
<wc:WYSIWYG runat="server"></wc:WYSIWYG>
I can NOT change the .aspx page's content which currently lives in Sharepoint and I have to to take the same code and run it outside of Sharepoint but still on an ASP.NET environment. It's cool and crazy at the sametime, I know.
When this aspx page is running in Sharepoint, I have to get the WYSIWYG editor control to use Sharepoint's WYSIWYG control. When the same aspx page is running outside of Sharepoint but still in an ASP.NET environment, I need it to use a different server control that's not dependent/from Sharepoint. How could I modify the code-behind to perform this toggling? Is this even possible?
View 1 Replies
Similar Messages:
Sep 3, 2010
I've ready everything I can find on the built-in validators but can't figure out how to do the sort of validation I need on theclient-side (I can do it on the server-side). Business rule I want to enforce (review the gridview snippet below) is if user checks the CheckBox_EditLifeCycleRpt control but doesn't enter a value in the TextBox_LifeExpectancy control then the validation should fail.
[Code]....
Like I said I can get this done on the server-side but thought it would be a good opportunity to learn how to use one of the compare validators. Also (FYI) I'm not too good at authoring Javascript but I can copy/modify other people's code fairly well.
View 1 Replies
Aug 5, 2010
My stored proc execution runs perfectly on local developement environment, but in QA environment it just returns an error after 5 min.s(My stored proc. takes arround 15 min.s to complete), when i run my Stored proc from query analyzer it runs perfectly in 15 min.s.
I tried to debug the code by pointing my local code to QA database, but that didn't give any error and ran perfectly. So i suspect there is something like commandtimeout happening in QA environment. Then i went on to check code at QA environment, it passes commandtimeout = 0 to the command object which means infinite.
View 3 Replies
Mar 27, 2010
How can I hide a control on a "Web Content Form" depending on what page is displaced.Working example. I have a control on a master page but I want this control to be hidden only when a particular page is loaded.
View 6 Replies
Feb 25, 2010
I have a with dynamic values from an Enum like: String, Int, Double, Bool, DateTime.How do I create a new Control depending on what is the SelectedValue dynamically into the page? I want a CheckBox for Bool, TextBox for String, Calendar for DateTime etc.
View 1 Replies
Sep 17, 2010
have added an asp menu to my site which i populate depending on the user/group from an entity framework object using a re-entrant function. This successfully adds menu items with associated child menu's to level n in the development environment.The problem comes when i publish to the server. when i view the published site the menu view changes and instead of a nice neat menu bar it shows a big list of the correct menuitems in a flat structure blanking out the rest of the page(asp menu is set to horizontal normally)server - windows server 2003 x64 - iis6 - asp 4.0.30319 + net4 framework packsdev - windows 7 - Visual studio 2010i am checking both sites with the same browsers so its not a browser issue.
View 6 Replies
May 14, 2010
I work in a group of 4 .Net developers. We rarely work on the same project at the same time but it does happen from time to time.We use TFS for source control. My most recent example is a project I just placed into production last night that included 2 WCF services and a web application front end. I worked out of a branch called "prod" because the application is brand new and has never seen the light of day. Now that the project is live, I need to branch off the prod branch for features, bugs, etc...
So what is the best way to do this?
Do I simple create a new branch and sort of archive the old branch and never use it again?
Do I branch off and then merge my branch changes back into the prod branch when I want to deploy to production?
And what about the file and assembly version. They are currently at 1.0.0.0. When do they change and why? If I fix a small bug, which number changes if any? If I add a feature, which number changes if any?
What I am looking for is what you have found to be the best way to efficiently manage source control. Most places I have worked always seem to bang heads with the source control system in on way or another and I would just like to find out what you have found that works the best.
View 6 Replies
Feb 11, 2011
I have a master document which is composed of other document types (some are required and some are not). While the master document's status is "Draft" I need to ignore all not nullable constraints (because the writer may decide to work on one of the children
documents that is not required and save as draft).
The closest solution I found for this problem is check constraints but I have not yet to see an example of this in check contraint and I'm not even sure if this is possible. Has anyone implemented a similar solution with check constraints (or any other methods)?
View 2 Replies
Sep 17, 2010
I am sorry to be asking what is probably a really stupid question, but i have a problem with my asp menu, when i run it on my dev machine(thru vs2010) it works perfectly, all the menu's are displayed correctly with the correct child items in the correct order but when i publish it to the server all the menu items become flat and take up the whole page. I am populating the menu using a reentrant function as follows to call the function and add the menus i am using
Dim childMenuItems As List(Of MenuItem) = CreateMenuLevel(0, uniquemenulist)
childMenuItems.ForEach(Sub(n) NavigationMenu.Items.Add(n))
Public Function CreateMenuLevel(ByVal parentId As Integer, ByVal menulist As List(Of MenuList)) As List(Of MenuItem)
Dim menuItems As New List(Of MenuItem)
For Each menuListItem As MenuList In menulist.Where(Function(n) n.ParentId = parentId)
Dim MenuItem As New MenuItem
If (Not String.IsNullOrEmpty(menuListItem.PagePath)) Then
MenuItem.NavigateUrl = menuListItem.PagePath
End If
MenuItem.Text = menuListItem.MenuName
MenuItem.Selectable = True
MenuItem.Enabled = True
menuItems.Add(MenuItem)
Dim childMenuItems As List(Of MenuItem) = createMenuLevel(menuListItem.MenuId, menulist)
childMenuItems.ForEach(Sub(n) MenuItem.ChildItems.Add(n))
Next
Return menuItems
End Function
now as i say this all works fine in the dev environment so i dont think its a coding issue unless i am missing something mad.
server 2003 x64
iis 6.0
asp 4.0.303.19
relevant .net 4 framework packs installed
dev environment
visual studio 2010
am using the same browser for to check both dev and server
View 2 Replies
Feb 24, 2010
We are looking to integrate Memcached into our infrastructure, but have a security concern before we do. We run several platforms including ASP.NET and ColdFusion and have many app developers working many little applications across the different platforms. The concern is this: App A places item "dog" into cache.
App B reads item "dog" (or worse: App B updates item "dog")
After this happens, App A either retrieves bad information, or has already had its information viewed, aka "stolen". What we would like to do is make it so that each app can only interact with its own sandbox, and may not interfere with or read other application's data.
View 3 Replies
May 14, 2010
How to use or implement ajax mocdalpopup control in asp.net under visual studio 2008 enviornment.
View 3 Replies
Feb 9, 2011
I have an intranet ASP.NET web application in which I need to get the IP of the client's machine. I do this vis the following code:
HttpContext.Current.Request.ServerVariables.Item("REMOTE_HOST")
It used to work when my ASP.NET site was only hosted on a single server. However once we got the load balancer installed and migrated our apps to a web farm, the code above returns the IP of the Load Balancer device and not of the client anymore.
I am working with the networking folks to determine what can be configured differently with the load balancer, but in the meantime I was wondering if there was another way I could get the client's IP other than using that IIS Server Variable?
View 1 Replies
Jan 18, 2011
I've read up on SQL Server 2008's encryption function, but I'm not convinced that's the route I want to go. My problem ultimately boils down to the fact that we're either using symmetric keys or assymetric keys encrypted by a symmetric key. Thus it seems like a SQL injection attack could lead to a data leak. I realize permissions should prevent that, permissions should also prevent the leaking in the first place.
It seems to me the better method would be to asymmetrically encrypt the data in the web application. Then store the private key offline and have a fat client that they can run the few times a year they need to access the restricted data so the data could be decrypted on the client. This way, if the server get compromised, we don't leak old data although depending on what they do we may leak future data. I think the big disadvantage is this would require re-writing the web application and creating a new fat application (to pull the restricted data). Due to the recent problem, I can probably get the time allocated, so now would be the proper time to make the recommendation.
View 3 Replies
Feb 5, 2010
I have a form where a user asks for a quote and we need to send an attached application form. all this worked in the dev environment but when I post the changes onto our hosted server (third party ISP) I get an error when the attachment is added. I have tired to use URL's but that does not work, at the moment I am using a relative path, but have also tried to place the file in the forms page folder.
Here is my attachment code:
string strFullPath = System.Web.HttpContext.Current.Server.MapPath(pRelativePath);
Attachment myAttachment = new Attachment(strFullPath, System.Net.Mime.MediaTypeNames.Application.Pdf);
myMsg.Attachments.Add(myAttachment);
this is in a try - catch block and I get the error "Could not find file".
View 2 Replies
Mar 25, 2011
I need to create a web application where the layout of the site is entirely programmatically generated - about the only thing that's done declaratively in the markup is the header. Basically, it's one of those AJAX-enabled entire-site-within-a-single-page type of sites where huge chunks of content (structured as modules such as navigation panes for example) are swapped in and out on the fly. From lowest-level to highest-leveled, the options I've considered are:
Classic ASP - Since ASP provides full control over the final output, this would be perfect if not for the lack of separation between logic and presentation and the subsequent lack of code reusability. ASP.NET MVC - REST and MVC routing seem like a poor fit, since there's only 1 actual webpage. Also, interpreting and transforming data and even the UI itself based on business rules (as opposed to direct user input) lies well outside of the deterministic CRUD operations that MVC excels at.
ASP.NET Webforms - Tried something like this using Webforms in the past, but ended up fighting with the ViewState and Postback event model every step of the way. Needless to say, performance was extremely poor and the codebehind was a mess due to the complex logic needed to fully and precisely regenerate each and every single aspect of the page on every single Postback. Silverlight - To be honest, I've never used this. Non-Microsoft technologies - None of the popular ones (PHP, JSP/J2EE, Flash) are entirely suitable either.
View 2 Replies
Apr 16, 2010
I have a Menu control in MasterPage based on web.sitemap file. My website has roles enabled (AspNetWindowsTokenRoleProvider) and uses Windows authentication mode. So, user has to be in a specific Windows Group to be able to access the site. I need to allow some users to see all menu nodes and some restricted set of nodes. How do I do that?
I would like to be able to create, say following Windows groups:
domain_namemy_app_users
domain_namemy_app_superusers
domain_namemy_app_admins
and code sitemap nodes this way:
<siteMapNode url="~/MOC_Masterdata_MOC_Approvers_Plain.aspx" title="MOC Approvers" description="MOC Approvers" />
View 5 Replies
Dec 24, 2010
How can i make a control required to put input depending on the radiobuttonlist selection? Let me try to clarify a bit more. I got 2 radiobuttons, if one gets selected, nothing else has to be done. But if the otherone gets selected, a textfield must have some input too.
View 2 Replies
Jul 16, 2010
Created a new virtual directory on my web sit in IIS 6.. set proper settings and wild card extensions... published via file system from dev environment to the server but i get a page cannot be found 404 error when browsing the site...
View 4 Replies
Jan 28, 2011
I have a .net web application in a load balanced environment over 3 servers. The load balancing is done with a load balancer. My site is [URL]with serveral javascript files such as [URL]
Is it possible to set it up that when request goes to server1 for [URL] then all javascript, css requests also go to server1, server2 or server3? Is there any web.config configuration that can be put in place to handle this?
View 1 Replies
Jul 4, 2010
some differences hosting a website on some remote server VS running it locally on dev environment.The reason why i am asking is, If I run my website locally it works fine no exceptions, runs smooth. But when deployed on a remote hosting server. Its like a nightmare to me :(very often i get object Instance not set to instance of object..... I am ok with the error message, But the same situation should happen locally,
View 6 Replies
Jan 27, 2011
I have to choose between Server.transfer and Response.redirect for an Intranet application for navigation. I have chosen Server.Transfer as of now because it avoid extra round trip to server and which will help when so many users will be accessing the application. (I believe this is the main difference between reponse.redirect and server.transfer). But the problem is now that URL won't change on Server.Transfer(I don't want to implement Http headerS, as I am afraid it will take time to implement that).on redirection, I want to do something like taking benefit of server.redirect(in avoiding server processing, which happens in response.redirect) and changing the URL(as it happens in reponse.redirect).Can anyone please suggest a quick solution to it or may be help me Telling How many users can reponse.redirect can support ?
View 11 Replies
Jan 13, 2010
I have a program called Bartender which is a labeling program and it can use Visual Studio as an interface. I have been given the task to make our staff have an easier way of processing a label.
The data which I need is on our P:/ NOTAPE directory. Now in this folder is a list of text files which our ERP system generates.
I want the user to open up a form and have the ability to type in the Batch file number and press return(TextBox1). On pressing the button(Button1), the File will then be picked up and then passed on to Bartender which will then go through the procedure of asking how many labels need to be printed.
This is my code so far.
[Code]....
View 2 Replies
Feb 10, 2011
I don't know how to do this, I think I need to find the control first.
[Code]....
View 26 Replies
May 7, 2010
Followed the code sample of Chapter 10 (Logging in) of the Book, Microsoft ASP.NET 2.0, I created an ASP.NET 3.5 website with Forms Authentication. The sample code used Website Administration Tool (WAT) to manage the users, roles, and authorization.When running in the ASP.NET Development server environment, I can first login, then click to open the links for each for the 3 roles.
However when running the sample code in the IIS server environment, I can login but can not open the links for the role subfolders.Clicking each link popped up an error message for opening a login.aspx from the specific subfolder. I don't have a Login.aspx file in each subfolder.The 3 role subfolders were configured as the virtual folders in the IIS Server. Why the sample code worked fine inASP.NET Development server environment, but got an error message from theIIS Server environment? Why an authenticated user can not open the subfolder homepage?
View 5 Replies
Sep 8, 2010
I have two texboxes (text_start and text_end) both using calandarextenders to pick dates. What I im trying to do is when the user picks the "text_end" date - this will force an update panel to refresh. This updatepanel holds a single dropdown whose sqldatasource uses both dates as parameters.
View 3 Replies