Search Results

Search found 5414 results on 217 pages for 'otn j master'.

Page 164/217 | < Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >

  • Help with MVC controller: passing a string from view to controller

    - by 109221793
    Hi guys, I'm having trouble with one particular issue, I was hoping someone could help me out. I've completed the MVC Music Store tutorial, and now I'm trying to add some administrator functionality - practice as I will have to do this in an MVC application in my job. The application is using the aspnet membership api, and what I have done so far is created a view to list the users. What I want to be able to do, is click on the users name in order to change their password. To try and carry the username to the changeUserPassword controller (custom made). I registered a new route in the global.asax.cs file in order to display the username in the URL, which is working so far. UserList View <%: Html.RouteLink(user.UserName, "AdminPassword", new { controller="StoreManager", action="changeUserPassword", username = user.UserName }) %> Global.asax.cs routes.MapRoute( "AdminPassword", //Route name "{controller}/{action}/{username}", //URL with parameters new { controller = "StoreManager", action = "changeUserPassword", username = UrlParameter.Optional} ); So now the URL looks like this when I reach the changeUserPassword view: http://localhost:51236/StoreManager/changeUserPassword/Administrator Here is the GET changeUserPassword action: public ActionResult changeUserPassword(string username) { ViewData["username"] = username; return View(); } I wanted to store the username in ViewData as I would like to use it in the GET changeUserPassword for display purposes, and also as a hidden value in the form. This is in order to pass it through to enable me to reset the password. Having debugged through the code, it seems that 'username' is null. How can I get this to work so that the username carries over from the Html.RouteLink, to the changeUserPassword action? Any help would be appreciated :) Here is my complete code: UserList.aspx <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Security.MembershipUserCollection>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> UserList </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>UserList</h2> <table> <tr> <th>User Name</th> <th>Last Activity date</th> <th>Locked Out</th> </tr> <%foreach (MembershipUser user in Model){ %> <tr> <td><%: Html.RouteLink(user.UserName, "AdminPassword", new { controller="StoreManager", action="changeUserPassword", username = user.UserName }) %></td> <td><%: user.LastActivityDate %></td> <td><%: user.IsLockedOut %></td> </tr> <% }%> </table> </asp:Content> changeUserPassword.aspx <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<musicStoreMVC.ViewModels.ResetPasswordAdmin>" %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> changeUserPassword </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2>Change Password: <%: ViewData["username"] %></h2> <% using (Html.BeginForm()) {%> <%: Html.ValidationSummary(true) %> <fieldset> <legend>Fields</legend> <div class="editor-label"> <%: Html.Hidden("username",ViewData["username"]) %> <%: Html.LabelFor(model => model.password) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.password) %> <%: Html.ValidationMessageFor(model => model.password) %> </div> <div class="editor-label"> <%: Html.LabelFor(model => model.confirmPassword) %> </div> <div class="editor-field"> <%: Html.TextBoxFor(model => model.confirmPassword) %> <%: Html.ValidationMessageFor(model => model.confirmPassword) %> </div> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %> <div> <%: Html.ActionLink("Back to List", "Index") %> </div> </asp:Content> My actions public ActionResult UserList() { var users = Membership.GetAllUsers(); return View(users); } public ActionResult changeUserPassword(string username) { ViewData["username"] = username; return View(); }

    Read the article

  • Why uses git fast-forward merging per default?

    - by Florian Pilz
    Coming from mercurial, I'm using branches to organize features. Naturally I want to see this work-flow in my history as well. But I started my new project with git and finished a feature. After merging I realized that git used fast-forward and forgot about my branch. So to think into the future: I'm the only one working on this project. If I use the default approach of git (fast-forward merging) my history would result in one giant master branch. I don't want this and can't see any good reason making this default. Maybe there are reasons, but what's so striking about it, that it has to be the default action?

    Read the article

  • How can I graph the Lines of Code history for git repo?

    - by dbr
    Basically I want to get the number of lines-of-code in the repository after each commit. The only (really crappy) ways I have found is to use git filter-branch to run "wc -l *", and a script that run git reset --hard on each commit, then ran wc -l To make it a bit clearer, when the tool is run, it would output the lines of code of the very first commit, then the second and so on.. This is what I want the tool to output (as an example): me@something:~/$ gitsloc --branch master 10 48 153 450 1734 1542 I've played around with the ruby 'git' library, but the closest I found was using the .lines() method on a diff, which seems like it should give the added lines (but does not.. it returns 0 when you delete lines for example) require 'rubygems' require 'git' total = 0 g = Git.open(working_dir = '/Users/dbr/Desktop/code_projects/tvdb_api') last = nil g.log.each do |cur| diff = g.diff(last, cur) total = total + diff.lines puts total last = cur end

    Read the article

  • Why can't I share a variable between two content sections in an ASP.NET MVC View?

    - by Dave Van den Eynde
    I have an ASP.NET MVC View with the typical TitleContent and MainContent, with a fairly complicated title that I want to calculate once and then share between these two content sections, like so: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %> <% var complicatedTitle = string.Format("{0} - {1}", Model.FirstThing, Model.SecondThing); %> <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> <%: complicatedTitle %> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h2><%: complicatedTitle %></h2> </asp:Content> This, however, doesn't work, as the resulting error message would say that only Content controls are allowed directly in a content page that contains Content controls. The calculation definately belongs in the view. How do you solve this problem?

    Read the article

  • TableAdapter to return ONLY selected columns? (VS2008)

    - by MattSlay
    (VS2008) I'm trying to configure a TableAdapter in a Typed DataSet to return only a certain subset of columns from the main schema of the table on which it is based, but it always returns the entire schema (all columns) with blank values in the columns I have omitted. The TableAdpater has the default Fill and GetData() methods that come from the wizard, which contain every column in the table, which is fine. I then added a new parameterized query method called GetActiveJobsByCustNo(CustNo), and I only included a few columns in the SQL query that I actually want to be in this table view. But, again, it returns all the columns in the master table schema, with empty values for the columns I omitted. The reason I am wanting this, is so I can just get a few columns back to use that table view with AutoGenerateColumns in an ASP.NET GridView. With it giving me back EVERY column i nthe schema, my presentation GridView contains way more columns that I want to show th user. And, I want to avoid have to declare the columns in the GridView.

    Read the article

  • Restore Partioned database into multiple filegroups

    - by Renju
    does anyone have any query to restore partioned db that having multiple file groups,In the restore option in the SSME i need to edit manually all the path of the filegroups restore as option it little bit tedious as it having more than 150 filegroups eg:USE master GO -- First determine the number and names of the files in the backup. RESTORE FILELISTONLY FROM MyNwind_1 -- Restore the files for MyNwind. RESTORE DATABASE MyNwind FROM MyNwind_1 WITH NORECOVERY, MOVE 'MyNwind_data_1' TO 'D:\MyData\MyNwind_data_1.mdf', MOVE 'MyNwind_data_2' TO 'D:\MyData\MyNwind_data_2.ndf' GO -- Apply the first transaction log backup. RESTORE LOG MyNwind FROM MyNwind_log1 WITH NORECOVERY GO -- Apply the last transaction log backup. RESTORE LOG MyNwind FROM MyNwind_log2 WITH RECOVERY GO Here i need to specify multiple MOVE command for all my filegroups,this is a tedious task when having more than 100s of filegroups MOVE 'MyNwind_data_1' TO 'D:\MyData\MyNwind_data_1.mdf', MOVE 'MyNwind_data_2' TO 'D:\MyData\MyNwind_data_2.ndf' I need to move the files into the path i provided as a parameter.Please help. Regards Renju http://blog.renjucool.com

    Read the article

  • How to call an extended procedure from a function

    - by Alan Featherston Lago
    hi im having trouble trying to get the following function to work. CREATE FUNCTION test ( @nt_group VARCHAR(128) ) RETURNS @nt_usr TABLE ( [name] [nchar](128) NULL , [type] [char](8) NULL , [privilege] [char](9) NULL , [mapped login name] [nchar](128) NULL , [permission path] [nchar](128) NULL ) AS BEGIN INSERT INTO @nt_usr EXEC master.dbo.xp_logininfo 'DOMAIN\USER', @nt_group RETURN END As far as i know i should be allowed to call an extended stored procedure, im getting the following error Mes 443, Level 16, State 14 Could it be that xp_logininfo might return different result sets depending on the parameters? When i use openquery i can overcome this by setting this: SET FMTONLY OFF. Does anyone know if there's a similar workaround for my problem?

    Read the article

  • Simple github fetch/merge not pulling in remote branch?

    - by chum of chance
    I have a project I forked on github to my repository. I made changes on the "experiment" branch of the project the committed the project to my fork. If you go to my branch on Github you can see the that the experiment branch was correctly committed. I would like to merge the experiment branch with the original repo (which I have rights to). I issued the following commands: git clone [email protected]:originalrepo/theproject.git git checkout -b experiment origin/experiment cd theproject git remote add experiment [email protected]:chumofchance/theproject.git git fetch experiment git merge experiment "Already up to date" However, when I view the project in explorer, it appears that nothing has changed. Am I screwing something up in regards to fetching the experiment branch (vs the master branch)?

    Read the article

  • Why can't I publish MVC project

    - by Vnuk
    I'm having problems publishing my MVC project. When I do publish and upload everything to web server I get this: [InvalidOperationException: The view 'Index' or its master could not be found. The following locations were searched: ~/Views/Home/Index.aspx ~/Views/Home/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx] Weird thing is that Index.aspx exists in ~/Views/Home/, but IIS cannot find it there. If I copy entire project to web server and let asp.net compile it on the fly it works like a charm. My routing code: routes.MapRoute( _ "Default", _ "{controller}/{action}/{id}", _ New With {.controller = "Home", .action = "Index", .id = ""} _ ) routes.MapRoute("Root", "", New With {.controller = "Home", .action = "Index", .id =""}) I'm using IIS7 on Windows 2008 Web server. ASP.NET MVC 1.0, Visual Studio 2008. I've tried it local with IIS7 on Windows 7 - same error.

    Read the article

  • What guides or standards do you use for CVS in your team ?

    - by PaulHurleyuk
    I'm starting to do a small amount of development within my company. I'm intending to use Git for CVS, and I'm interested to see what guidelines or standards people are using around CVS in their groups, similar to coding standards are often written within the group for the group. I'm assuming there will be things like; Commit often (at least every day/week/meeting etc) Release builds are always made from the master branch Prior to release, a new branch will be created for Testing and tagged as such. only bug fixes from this point onwards. The final release of this will be tagged as such and the bug fixes merged back into the trunk Each developer will have a public repo New features should get their own branch Obviously a lot of this will depend on what cvs you're using and how you've structured it. Similar Questions; http://stackoverflow.com/questions/273695/git-branch-naming-best-practices http://stackoverflow.com/questions/2006265/is-there-an-standard-naming-convention-for-git-tags

    Read the article

  • Recover from inadvertent skip during rebase

    - by Benjol
    I just tried to rebase a very old branch with a minor modification onto my master. There was a problem with merging just one of the three files involved, so I did an unthinking --skip, thinking that it would just skip that file, but as it happened, it seems to have skipped all my changes, and rolled forwards. So now the rebase is finished, and my changes seem to have disappeared. I've seen the question about undoing rebase, but it's all greek to me, I see the reflog, but I don't know which commit the branch was attached to before the rebase. In any case, I don't really need to undo the rebase, I just want to be able to recover the changes in the two files. Is there anyway to do this properly (failing this, I'll just have to restore yesterday's backup of my repository and pick the bits out by hand).

    Read the article

  • Msdtc Transaction

    - by Shimjith
    I am using Linked server For Tansaction example Alter Proc [dbo].[usp_Select_TransferingDatasFromServerCheckingforExample] @RserverName varchar(100), ----- Server Name @RUserid Varchar(100), ----- server user id @RPass Varchar(100), ----- Server Password @DbName varchar(100) ----- Server database As Set nocount on Set Xact_abort on Declare @user varchar(100) Declare @userID varchar(100) Declare @Db Varchar(100) Declare @Lserver varchar(100) Select @Lserver = @@servername Select @userID = suser_name() select @User=user Exec('if exists(Select 1 From [Master].[' + @user + '].[sysservers] where srvname = ''' + @RserverName + ''') begin Exec sp_droplinkedsrvlogin ''' + @RserverName + ''',''' + @userID + ''' exec sp_dropserver ''' + @RserverName + ''' end ') set @RserverName='['+@RserverName+']' BEGIN TRY BEGIN TRANSACTION declare @ColumnList varchar(max) set @ColumnList = null select @ColumnList = case when @ColumnList is not null then @ColumnList + ',' + quotename(name) else quotename(name) end from syscolumns where id = object_id('bditm') order by colid set identity_insert Bditm on exec ('Insert Into Bditm ('+ @ColumnList +') Select * From '+ @RserverName + '.'+ @DbName + '.'+ @user + '.Bditm') set identity_insert Bditm off Commit Select 1 End try Begin catch if (@@ERROR < 0) Begin if @@trancount 0 Begin Rollback transaction Select 0 END End End Catch set @RserverName=replace(replace(@RserverName,'[',''),']','') Exec sp_droplinkedsrvlogin @RserverName,@userID Exec sp_dropserver @RserverName this is the Error Occuerd The Microsoft Distributed Transaction Coordinator (MS DTC) has cancelled the distributed transaction.

    Read the article

  • Manipulate Page Theme Programatically

    - by Aren B
    I've got the following Setup in my Theme: \App_Themes\Default\StyleSheet.css \App_Themes\Default\PrintStyleSheet.css The PrintStyleSheet.css file has a set of printing css rules set in them wrapped in an @Media Print { } block. I need a way to programmatically remove the PrintStyleSheet.css from the list of css files for ASP.NET to inject based on some flags. (Some instances we want to print the site verbatim without custom formatting). I know i could build a seperate theme without the PrintStyleSheet.css in it and switch the theme programmatically, however this would introduce duplication of my master stylesheet which is not acceptable. Any ideas?

    Read the article

  • Hadoop on Amazon EC2 : Job tracker not starting properly

    - by Algorist
    Hi, We are running Hadoop on Amazon EC2 cluster. We start the master, slaves and attach the ebs volumes and finally waiting for hadoop jobtracker, tasktracker etc to start and we have timeout of 3600 seconds. We are noticing 50% of the time that job tracker is not able to start before the timeout. Reason being, hdfs is not initialized properly and still in safemode and job tracker is unable to start. I noticed few connectivity issues between nodes on EC2 as I tried manually pinging slaves. Did anyone face similar issue and know how to solve this? Thank you Bala

    Read the article

  • SQL server 2005 - Any one have any idea?, i want to write the script so tuser have access that new c

    - by Paresh
    i have created one user named tuser with create database rights in SQL server 2005. and given the 'db_owner' database role of master and msdb database to tuser . From this user login when i run the script for create database then it will create new database. But tuser don't have access that newly created database generated from script. Any one have any idea?, i want to write the script so tuser have access that new created database after creation and can have add user permission of newly created database.

    Read the article

  • Building a subquery with ARel in Rails3

    - by Christopher
    I am trying to build this query in ARel: SELECT FLOOR(AVG(num)) FROM ( SELECT COUNT(attendees.id) AS num, meetings.club_id FROM `meetings` INNER JOIN `attendees` ON `attendees`.`meeting_id` = `meetings`.`id` WHERE (`meetings`.club_id = 1) GROUP BY meetings.id) tmp GROUP BY tmp.club_id It returns the average number of attendees per meeting, per club. (a club has many meetings and a meeting has many attendees) So far I have (declared in class Club < ActiveRecord::Base): num_attendees = meetings.select("COUNT(attendees.id) AS num").joins(:attendees).group('meetings.id') Arel::Table.new('tmp', self.class.arel_engine).from(num_attendees).project('FLOOR(AVG(num))').group('tmp.club_id').to_sql but, I am getting the error: undefined method `visit_ActiveRecord_Relation' for #<Arel::Visitors::MySQL:0x9b42180> The documentation for generating non trivial ARel queries is a bit hard to come by. I have been using http://rdoc.info/github/rails/arel/master/frames Am I approaching this incorrectly? Or am I a few methods away from a solution?

    Read the article

  • How do I switch to a SQL Server Server Database that will exist after another command?

    - by Jason Young
    I can't get this script to run, because SQL management studio 2008 says the table "NewName" does not exist. However, the script's purpose is to rename an existing database, so that it does exist when it gets to that line. Ideas? Use Master; ALTER DATABASE OldName SET SINGLE_USER WITH NO_WAIT; ALTER DATABASE OldName MODIFY NAME = NewName; ALTER DATABASE NewName SET MULTI_USER; Use NewName; --THIS LINE FAILS BEFORE THE SCRIPT EVEN RUNS!

    Read the article

  • How can I programmatically find the IP address/netmask/gateway configured for a specific network dev

    - by Oren S
    Hi I would like to write a piece of code which checks, for each network device (e.g. eth0, lo, master devices) some statistics and configuration data about that device. I could find the statistics data (and most of the configuration data) in /sys/class/net/..., however, I couldn't find any C/C++ API or any entry in procfs/sysfs listing the inet addr, netmask and gateway. Some alternatives I checked: parsing the output from ifconfig/route/some other utilities: I don't want to start a subprocess every time I need to do the inspection. parsing /etc/sysconfig/network-scripts/: will give me only the start-up configuration, and not the current state. Also, since this code is intended for a product in my workplace, where every external library is inspected thoroughly (meaning it will take me forever to add any external library) I prefer solutions which rely on Linux native API and not external libraries. Thanks!

    Read the article

  • PlaceHolderMain controlling td width of hard-coded values

    - by Linda
    In my custom .master page I have the following code: <asp:ContentPlaceHolder id="PlaceHolderMain" runat="server" Visible="true" /> This prints out the main content of my page. It contains this structure <table ID="OuterZoneTable" width="100%"> <tr>...</tr> <tr id="OuterRow"> <td width="80%" id="OuterLeftCell">...</td> <td width="180" id="OuterRightCell">...</td> </tr> ... </table> I want to control the width of #OuterLeftCell and #OuterRightCell but it is hard-coded in the html that is returned. How would I change these values?

    Read the article

  • Managing Static Library project as a module like Framework on iOS project in Xcode4.

    - by Eonil
    (Solution Note, I'll answer immediately) Many people including me trying to make a kind of Static Library framework for iOS to archive some kind of modularity. Framework is best way to do this, but it doesn't provided by Apple, and workarounds don't work well. https://github.com/kstenerud/iOS-Universal-Framework/tree/master/Fake%20Framework/Templates Fake framework cannot be referenced from linking tab in Build Phases. Real framework needs modification of system setting. And still not work smoothly on every parts. Problem is static library need header files, and it's impossible to reference header files on project at another location on different project without some script. And script breaks IDE's file management abstraction. How can I use static library project like a convenient module manner? (just dragging project into another project to complete embedding)

    Read the article

  • filter to reverse lines of a text file

    - by Greg Hewgill
    I'm writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing? My specific application is that I'm getting a list of Git commit identifiers, and I want to process them in reverse order: git log --pretty=oneline work...master | grep -v DEBUG: | cut -d' ' -f1 | reverse The best I've come up with is to implement reverse like this: ... | cat -b | sort -rn | cut -f2- This uses cat to number every line, then sort to sort them in descending numeric order (which ends up reversing the whole file), then cut to remove the unneeded line number. The above works for my application, but may fail in the general case because cat -b only numbers nonblank lines. Is there a better, more general way to do this?

    Read the article

  • Override ~ behaviour in controls

    - by cpf
    Quick backstory: I'm making a "framed" version of my site that has a different master page than normal (one suitable for iframing). It's accessed by mysite.com/Framed/whatever, instead of mysite.com/whatever. This is rewritten in IIS to mysite.com/whatever?framed=true. That works fine. The issue I'm having is that all the links are relative using a ~ like ~/Server.aspx which works fine in the normal site. I need to override that so instead of producing ../Server.aspx (as it "should") it produces ../Framed/Server.aspx or Server.aspx. Currently this means that the page goes back to it's normal view (mystite.com/whatever2) as soon as you click on a link, I want it to continue to stay in mysite.com/Framed/...

    Read the article

  • Efficiency of while(true) ServerSocket Listen

    - by Submerged
    I am wondering if a typical while(true) ServerSocket listen loop takes an entire core to wait and accept a client connection (Even when implementing runnable and using Thread .start()) I am implementing a type of distributed computing cluster and each computer needs every core it has for computation. A Master node needs to communicate with these computers (invoking static methods that modify the algorithm's functioning). The reason I need to use sockets is due to the cross platform / cross language capabilities. In some cases, PHP will be invoking these java static methods. I used a java profiler (YourKit) and I can see my running ServerSocket listen thread and it never sleeps and it's always running. Is there a better approach to do what I want? Or, will the performance hit be negligible? Please, feel free to offer any suggestion if you can think of a better way (I've tried RMI, but it isn't supported cross-language. Thanks everyone

    Read the article

  • Why is Visual Studio 2008 slow with Firefox?

    - by Edward Tanguay
    I am using Microsoft Visual Web Developer 2008 Express. I've made an ASP.NET MVC site which has 6 CSS files and 6 Javascript files in the HEAD element in the Site.Master file. When I do F5 or CTRL-F5 in Explorer or Opera, the site displays instantly. When I run my site in Firefox, it takes a SECOND for each CSS and each Javascript file on LOCALHOST, i.e. 12 seconds to load on localhost. What might I be able to change in the Firefox settings so it is as fast as Opera and Explorer? NEW INFO: Uninstalled Firebug completely, no yslow, no other add-ons. When I take out the CSS and Javascript files, then Firefox is as fast as the other browsers. What could be taking it so long on a local connection?

    Read the article

  • Should I trust Redis for data integrity?

    - by Jiaji
    In my current project, I have PostgreSQL as my master DB, and Redis as kind of a slave, e.g., when some user adds another as a friend, first the relationship will be stored in PostgreSQL and then a friend list in Redis will be updated. When some user's friend list is requested, it will be pulled out of Redis instead of PostgreSQL. The question is: when I update the friend list in Redis, should I get a fresh copy outof PostgreSQL, and replace the old list in Redis with the new one or should I keep the old list and simply SADD the userid into the list? The latter is of course best for performance, but intuitively the former does a better job in keep the data integrity? And if something like Celery is used, is the second method worth the risk?

    Read the article

< Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >