Search Results

Search found 129 results on 6 pages for 'malcolm osborne'.

Page 4/6 | < Previous Page | 1 2 3 4 5 6  | Next Page >

  • ASP.NET MVC Creating a impersonated user.

    - by Malcolm
    Hi, I have a MVC app where I have a User class and the user can also impersonate another user(Admin users only). So I have this code below that authenticates the request and instantiates my version of a User class. It then tries to get the impersonated user from the Session object but Session is not available in this method in the global.asax. Hope this makes sense. How else could I do this? protected void Application_OnAuthenticateRequest(object sender, EventArgs e) { IMylesterService service = ObjectFactory.GetInstance(); if (Context.User != null) { if (Context.User.Identity.IsAuthenticated) { User user = service.GetUser(Context.User.Identity.Name); if (user == null) throw new ApplicationException("Context.user.Identity.name is not a recognized user"); User impersonatedUser = (User)this.Session["ImpersonatedUser"]; if (impersonatedUser == null) user.ImpersonatedUser = user; else user.ImpersonatedUser = impersonatedUser; System.Threading.Thread.CurrentPrincipal = Context.User = user; return; } } User guest = service.GetGuestUser(); guest.ImpersonatedUser = guest; System.Threading.Thread.CurrentPrincipal = Context.User = guest; }

    Read the article

  • Execute HtttModule for extionsionless URL only

    - by Malcolm Frexner
    I have an httpModule which has to run before an ActionMethod. I dont want that it is executed when a request for an image comes in. For some reasons I realy need an HttpModule and cant use an ActionFilter What is the way to do this? public class PostAuthenticateModule : IHttpModule { public void Init(HttpApplication app) { app.PostAuthenticateRequest += new EventHandler(this.OnEnter); } private void OnEnter(object source, EventArgs eventArgs) { } private static void Initialize() { } public void Dispose() { } } web.config <httpModules> <add type="PostAuthenticateModule.PostAuthenticateModule , PostAuthenticateModule" name="PostAuthenticateModule"/> </httpModules>

    Read the article

  • Disable the mouse click event of a button placed inside a listbox item

    - by Malcolm
    I have a button placed inside a listbox item and i have style defined fro that button where i have two images and on mouse hover i change the image. Now the problem is I am handling the listbox mouse event and when click the button the listbox mouse event doesn't fires. I tried to make the property of button ishittestvisisble=false And now if i click on button the listbox mouse event fires but the problem is the two images placed inside the styling of button don't apply as they are the child of button and by default their ishittestvisible also turn out to be false. So any suggestion or idea will be helpfull ....tx in advance...

    Read the article

  • How do I code a comment box on my blog?

    - by Malcolm
    Obviously, I am a novice web designer. I'm using php and sql to do all the under-the-hood stuff, but I want a visually appealing as well as functional comment system. Right now I am just using HTML forms but they don't look very good. Should I be using javascript? Any tips to get me started?

    Read the article

  • What is the best way to get support from microsoft developers [closed]

    - by Malcolm Frexner
    I have a problem at my production web, that I am not able to solve. I am not able to reproduce the problem in stage or development. It only appears when the website is under heavy load. I think it is solvable if somebody who has a very good understanding of the internals of FormsAuthentication would have a look at it by logging into our system. It should be at least Scottgu! Somebody told me that Microsoft Premier Support is a good choice for this kind of problems. We have no MSDN subscription or other connection to microsoft that enables us to use MPS. Is there a way to get support on a incident base? Are there other ways to get this kind of support? EDIT Here is the problem itself: http://stackoverflow.com/questions/2448720/different-users-get-the-same-cookie-value-in-aspxanonymous

    Read the article

  • Which Javascript history back implementation is the best?

    - by Malcolm Frexner
    There are implementations for history.back in Micrososft AJAX and jQuery (http://www.asual.com/jquery/address/). I already have jQuery and asp.net ajax included in my project but I am not sure which implementation of history.back is better. Better for me is: Already used by some large projects Wide browser support Easy to implement Little footprint Does anybody know which one is better? EDIT: Another jquery plugin is http://plugins.jquery.com/project/history It is recommmended in the book JQuery Cookbook. This one worked well so far.

    Read the article

  • Are there any MVP Frameworks projects out there?

    - by Greg Malcolm
    MVC is used a number of popular frameworks. To name just a few, Ruby on Rails, ASP.NET MVC, Monorail, Spring MVC. Are there any equivalent frameworks using any variant of MVP? Most of the examples I've found online seem to be custom implementations of the pattern rather than reusable frameworks. Suggestions need not be specific to any particular programming language, my interest is mostly academic.

    Read the article

  • Trying to use HttpWebRequest to load a page in a file.

    - by Malcolm
    Hi, I have a ASP.NET MVC app that works fine in the browser. I am using the following code to be able to write the html of a retrieved page to a file. (This is to use in a PDF conversion component) But this code errors out continually but not in the browser. I get timeout errors sometimes asn 500 errors. Public Function GetPage(ByVal url As String, ByVal filename As String) As Boolean Dim request As HttpWebRequest Dim username As String Dim password As String Dim docid As String Dim poststring As String Dim bytedata() As Byte Dim requestStream As Stream Try username = "pdfuser" password = "pdfuser" docid = "docid=inv12154" poststring = String.Format("username={0}&password={1}&{2}", username, password, docid) bytedata = Encoding.UTF8.GetBytes(poststring) request = WebRequest.Create(url) request.Method = "Post" request.ContentLength = bytedata.Length request.ContentType = "application/x-www-form-urlencoded" requestStream = request.GetRequestStream() requestStream.Write(bytedata, 0, bytedata.Length) requestStream.Close() request.Timeout = 60000 Dim response As HttpWebResponse Dim responseStream As Stream Dim reader As StreamReader Dim sb As New StringBuilder() Dim line As String = String.Empty response = request.GetResponse() responseStream = response.GetResponseStream() reader = New StreamReader(responseStream, System.Text.Encoding.ASCII) line = reader.ReadLine() While (Not line Is Nothing) sb.Append(line) line = reader.ReadLine() End While File.WriteAllText(filename, sb.ToString()) Catch ex As Exception MsgBox(ex.Message) End Try Return True End Function

    Read the article

  • Issue with focus of a Silverlight Listbox

    - by Malcolm
    I have a button and on click of that i show a popup which has a listbox. popup named - popComboList Listbox named - lstComboBoxResult I am giving a focus to a listbox but at initial on a click of a button the listbox doesn't get focus-(this happens only once at initial, when i first time click button) After the second click it works. private void bnOpen_Click(object sender, RoutedEventArgs e) { if (IsDesignTime) return; lstComboBoxResult.Width = tbComboValue.ActualWidth + bnOpen.ActualWidth; if (!popComboList.IsOpen) { SetPopupPosition(popComboList); popComboList.IsOpen = true; lstComboBoxResult.Focus(); } else { popComboList.IsOpen = false; } }

    Read the article

  • Highlight the text of listboxitems inside a listbox depending on the textbox :

    - by Malcolm
    I have a listbox and I display incremental search result in it based on the text changed event of a textbox, everytime I update the listboxitemsource. The items displayed inside a listbox the text of it must be highlighted. Suppose the person enter in textbox sy and the listbox displays the result all getting started with sy : Somewhat like this..., System SystemDefault SystemFolder so for the all above 3 results Sy must be highlighted. How to achieve this? tx in advance

    Read the article

  • Different users get the same cookie - value in .ASPXANONYMOUS

    - by Malcolm Frexner
    My site allows anonymous users. I saw that under heavy load user get sometimes profile values from other users. This happens for anonymous users. I logged the access to profile data: /// <summary> /// /// </summary> /// <param name="controller"></param> /// <returns></returns> public static string ProfileID(this Controller controller ) { if (ApplicationConfiguration.LogProfileAccess) { StringBuilder sb = new StringBuilder(); (from header in controller.Request.Headers.ToPairs() select string.Concat(header.Key, ":", header.Value, ";")).ToList().ForEach(x => sb.Append(x)); string log = string.Format("ip:{0} url:{1} IsAuthenticated:{2} Name:{3} AnonId:{4} header:{5}", controller.Request.UserHostAddress, controller.Request.Url.ToString(), controller.Request.IsAuthenticated, controller.User.Identity.Name, controller.Request.AnonymousID, sb); _log.Debug(log); } return controller.Request.IsAuthenticated ? controller.User.Identity.Name : controller.Request.AnonymousID; } I can see in the log that user realy get the same cookievalue for .ASPXANONYMOUS even if they have different IP. Just to be safe I removed dependency injection for the FormsAuthentication. I dont use OutputCaching. My web.config has this setting for authentication: <anonymousIdentification enabled="true" cookieless="UseCookies" cookieName=".ASPXANONYMOUS" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" /> <authentication mode="Forms"> <forms loginUrl="~/de/Account/Login" /> </authentication> Does anybody have an idea what else I could log or what I should have a look at?

    Read the article

  • Best practice for string substition with gettext using Python

    - by Malcolm
    Looking for best practice advice on what string substitution technique to use when using gettext(). Or do all techniques apply equally? I can think of at least 3 string techniques: Classic "%" based formatting: "My name is %(name)s" % locals() .format() based formatting: "My name is {name}".format( locals() ) string.Template.safe_substitute() import string template = string.Template( "My name is ${name}" ) template.safe_substitute( locals() ) The advantage of the string.Template technique is that a translated string with with an incorrectly spelled variable reference can still yield a usable string value while the other techniques unconditionally raise an exception. The downside of the string.Template technique appears to be the inability for one to customize how a variable is formatted (padding, justification, width, etc).

    Read the article

  • Other ternary operators besides ternary conditional (?:)

    - by Malcolm
    The "ternary operator" expression is now almost equivalent to the ternary conditional operator: condition ? trueExpression : falseExpression; However, "ternary operator" only means that it takes three arguments. I'm just curious, are there any languages with any other built-in ternary operators besides conditional operator and which ones?

    Read the article

  • Regular Expression

    - by Malcolm
    I want regular expression that checks that the string doesnt start with an empty space. Some what like this i want to do : Is the below ValidationExpression right for it : string ValidationExpression = @"/^[^ ]/"; if (!String.IsNullOrEmpty(GroupName) && !Regex.IsMatch(GroupName, ValidationExpression)) { }

    Read the article

  • Sending a list of mails with SmtpClient

    - by Malcolm Frexner
    I use SendCompletedEventHandler of SmtpClient when sending a list of emails. The SendCompletedEventHandler is only called when have already sent all emails in the list. I expexted, that SendCompletedEventHandler is called one an email is send. Is there something wrong in my code? public void SendAllNewsletters(List<string> recipients) { string mailText = "My Tex"; foreach(string recipient in recipients) { //if this loop takes 10min then the first call to //SendCompletedCallback is after 10min SendNewsletter(mailText,recipient); } } public bool SendNewsletter(string mailText , string emailaddress) { SmtpClient sc = new SmtpClient(_smtpServer, _smtpPort); System.Net.NetworkCredential SMTPUserInfo = new System.Net.NetworkCredential(_smtpuser, _smtppassword); sc.Credentials = SMTPUserInfo; sc.SendCompleted += new SendCompletedEventHandler(SendCompletedCallback); MailMessage mm = null; mm = new MailMessage(mailText, emailaddress); mm.IsBodyHtml = true; mm.Priority = MailPriority.Normal; mm.Subject = "Something"; mm.Body = "Something"; mm.SubjectEncoding = Encoding.UTF8; mm.BodyEncoding = Encoding.UTF8; //Mail string userState = emailaddress; sc.SendAsync(mm, userState); return true; } public void SendCompletedCallback(object sender, AsyncCompletedEventArgs e) { // Get the unique identifier for this asynchronous operation. String token = (string)e.UserState; if (e.Error != null) { _news.SetNewsletterEmailsisSent(e.UserState.ToString(), _newslettername, false, e.Error.Message); } else { _news.SetNewsletterEmailsisSent(e.UserState.ToString(), _newslettername, true, string.Empty); } }

    Read the article

  • Why does adding a reference to project targeting .NET Framework 4.0 fail?

    - by Malcolm Post
    We have two projects that are both class libraries. Project 1 is a VS 2008 project and targets the .NET Framework 3.5. Project 2 is a VS 2010 (release candidate) project that targets the .NET Framework 4.0. When I try to add a reference to Project 2 in Project 1, it fails with a less than informative error message. I know that if I change the target Framework for Project 2 to 3.5, then adding the reference will work. My question is, if I don't change the target frameworks, but convert Project 1 to VS 2010, will the referencing work? Stated another way, is there some inherent incompatiblity between class libraries targeting different framework versions, or is it failing for me because VS 2008 doesn't know about the 4.0 framework?

    Read the article

  • The scroll viewer is not updating in silverlight

    - by Malcolm
    I have an image inside scroll viewer and i have a control for zooming the image and in zooming event i change the scale of an image ,as below : void zoomSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) { scale.ScaleX = e.NewValue; scale.ScaleY = e.NewValue; //scroll is a name of scrolviewer scroll.UpdateLayout(); } And a xaml below <Grid x:Name="Preview" Grid.Column="1"> <Border x:Name="OuterBorder" BorderThickness="1" BorderBrush="#A3A3A3" > <Border x:Name="InnerBorder" BorderBrush="Transparent" Margin="2" > <Grid Background="White" > <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <ScrollViewer x:Name="scroll" HorizontalScrollBarVisibility="Auto" Grid.Column="0" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Themes:ThemeManager.StyleKey="TreeScrollViewer"> <Image Source="../charge_chargeline.PNG" > <Image.RenderTransform> <CompositeTransform x:Name="**scale**" /> </Image.RenderTransform> </Image> </ScrollViewer> <Border HorizontalAlignment="Center" CornerRadius="0,0,2,2" Width="250" Height="24" VerticalAlignment="Top"> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> <GradientStop Color="#CDD1D4" Offset="0.0"/> <GradientStop Color="#C8CACD" Offset="1.0"/> </LinearGradientBrush> </Border.Background> <ChargeEntry:Zoom x:Name="zoominout" /> </Border> </Grid> </Border> </Border> </Grid>

    Read the article

  • CheckBox in silverlight

    - by Malcolm
    I have 4 check boxes and by default they are checked and depending on these check boxes i have to show a value some where else. for ex: suppose for first checkbox i say 1, second 2 ,third 3 and fourth 4 so initially i store this value in a string name dg="1,2,3,4" if the user unchecks the second check box the value in my dg must be showing : dg="1,3,4" And again if the user checks the second chekbox , my dg must store the value : dg="1,2,3,4" How to achieve this? TX in advance

    Read the article

  • Android Dev: The constructor Intent(new View.OnClickListener(){}, Class<DrinksTwitter>) is undefined

    - by Malcolm Woods Spark
    package com.android.drinksonme; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; public class Screen2 extends Activity { // Declare our Views, so we can access them later private EditText etUsername; private EditText etPassword; private Button btnLogin; private Button btnSignUp; private TextView lblResult; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the EditText and Button References etUsername = (EditText)findViewById(R.id.username); etPassword = (EditText)findViewById(R.id.password); btnLogin = (Button)findViewById(R.id.login_button); btnSignUp = (Button)findViewById(R.id.signup_button); lblResult = (TextView)findViewById(R.id.result); // Set Click Listener btnLogin.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // Check Login String username = etUsername.getText().toString(); String password = etPassword.getText().toString(); if(username.equals("test") && password.equals("test")){ final Intent i = new Intent(this, DrinksTwitter.class); //error on this line startActivity(i); // lblResult.setText("Login successful."); } else { lblResult.setText("Invalid username or password."); } } }); final Intent k = new Intent(Screen2.this, SignUp.class); btnSignUp.setOnClickListener(new OnClickListener() { public void onClick(View v) { startActivity(k); } }); } }

    Read the article

  • Linq2Sql How to write outer join query?

    - by Malcolm
    Hi, I have following SQL tables. ImportantMessages impID Message ImportantMessageUsers imuID imuUserID imuImpID I want to write a Linq2Sql query so that it returns any rows from ImportantMessages that does not have a record in ImportantMessagesUsers. Matchiing fields are impID ----- imuImpID Assume imuUserID of 6

    Read the article

  • HTML - Styling a input type=submit as an anchor and removing extra space rendered

    - by Malcolm
    Hi, I have the following HTML and you can see the extra space between the links when the page renders. How do trim this space? <div class="navLinks" style="text-align:right;margin-bottom:30px;"> <form action="/Invoice/SetPaid" method="post"><input id="id" name="id" type="hidden" value="11356" /> <input type="submit" value="Set To Paid" /> </form><form action="/Invoice/WorkInProgress" method="post"><input id="id" name="id" type="hidden" value="11356" /> <input type="submit" value="Set To Work In Progress" /> </form><form action="/Invoice/PrintVersion/11356" method="post"><input id="id" name="id" type="hidden" value="11356" /> <input type="submit" value="Printable Version" /> </form><form action="/Home/User" method="post"><input id="id" name="id" type="hidden" value="11356" /> <input type="submit" value="Continue" /> </form> </div> .navLinks form { display:inline; } .navLinks input { text-decoration:underline; background-color:white; color: #034af3; border: 0px none; text-align:center; } .navLinks input:hover { text-decoration:none; }

    Read the article

  • How can I find all items beginning with a or â?

    - by Malcolm Frexner
    I have a list of items that are grouped by their first letter. By clicking a letter the user gets alle entries that begin with that letter. This does not work for french. If I choose the letter a, items with â are not returned. What is a good way to return items no matter if they have an accent or not? <% char alphaStart = Char.Parse("A"); char alphaEnd = Char.Parse("Z"); %> <% for (char i = alphaStart; i <= alphaEnd; i++) { %> <% char c = i; %> <% var abcList = Model.FaqList.Where(x => x.CmsHeader.StartsWith(c.ToString())).ToList(); %> <% if (abcList.Count > 0 ) { %> <div class="naviPkt"> <a id="<%= i.ToString().ToUpper() %>" class="naviPktLetter" href="#<%= i.ToString().ToLower() %>"><%= i.ToString().ToUpper() %></a> </div> <ul id="menuGroup<%= i.ToString().ToUpper() %>" class="contextMenu" style="display:none;"> <% foreach (var info in abcList) { %> <li class="<%= info.CmsHeader%>"> <a id="infoId<%= info.CmsInfoId%>" href="#<%= info.CmsInfoId%>" class="abcEntry"><%= info.CmsHeader%></a> </li> <% } %> </ul> <% } %> <% } %>

    Read the article

< Previous Page | 1 2 3 4 5 6  | Next Page >