Tag Archives: Menu

Menu

[RESOLVED]from data in a class to a database

To get more familiar with MVC, I worked through the exercise in asp.net/mvc/overview/older-versions/creating-a-mvc-3-application-with-razor-and-unobtrusive-javascript. In this exercise, there is a Users class which substitutes for a database:

public class Users {
	public Users() {
		_userList.Add(new UserModel
			{
				UserName = "queene",
				FirstName = "Queen",
				LastName = "Elizabeth",
				City = "Buckingham"
			});
		_userList.Add(new UserModel
			{
				UserName = "annb",
				FirstName = "Ann",
				LastName = "Beebe",
				City = "Boston"
			});
					
	}

	public List<UserModel> _userList = new List<UserModel>();

	public void Update(UserModel umToUpdate)
	{
		foreach(UserModel um in _userList)
		{
			if(um.UserName == umToUpdate.UserName)
			{
				_userList.Remove(um);
				_userList.Add(umToUpdate);
				break;
			}
		}
	}

	public void Create(UserModel umToUpdate)
	{
		foreach(UserModel um in _userList)
		{
			if (um.UserName == umToUpdate.UserName)
				throw new System.InvalidOperationException("Duplicate username: " + um.UserName);
		}
		_userList.Add(umToUpdate);
	}

	public void Remove(string userName)
	{
		foreach (UserModel um in _userList)
			if (um.UserName == userName)
			{
				_userList.Remove(um);
				break;
			}
	}

	public UserModel GetUser(string uid)
	{
		UserModel userModel = null;
		foreach (UserModel um in _userList)
			if (um.UserName == uid)
				userModel = um;
		return userModel;
	}

}

I also created an EF context based on a database table. I want to convert the little project over to using the database but I’m not sure how to set it up. I went through another practice site (asp.net/mvc/overview/getting-started/database-first-development/creating-the-web-application),
which was more concerned with scaffolding the DB into the project. The problem with that is I believe the scaffolding menus referred to there were for .Net 4.5 and I work with 4.0, so it got kind of confusing. Anyway, does anyone have any sources or suggestions
that might help me out? (scaffolding or not) Let me know if there’s any more code you need to see. Thanks in advance for your help.

I don’t know if it makes a difference anywhere else but on the Index view, but I’m using Razor.

Hi muybn,

To learn MVC with EF, please refer to:

# Models and Data Access

http://www.asp.net/mvc/overview/older-versions/mvc-music-store/mvc-music-store-part-4

# Getting Started with Entity Framework 6 Code First using MVC 5

http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application

Best Regards

Starain

Thank you, Starain. I’m sure these references will be helpful.

[RESOLVED]After updating from VS2012 to VS2013, CS1061 compile error

For my MVC 4 web application, I updated 3 machines from VS2012 to VS2013, applied VS2013.4 update, ran NuGet> Install-Package Microsoft.AspNet.Mvc -Version 4.0.40804.0 -Project (project name).

The solution rebuilds with no errors.

But when I run the web site in IISExpress under the debugger, on two of the machines I get a compile error in the browser that comes up:

Compiler Error Message: CS1061: ‘object’ does not contain a definition for ‘SubMenuItem’ and no extension method ‘SubMenuItem’ accepting a first argument of type ‘object’ could be found (are you missing a using directive or an assembly reference?)

Source Error:
Line 3:  <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Line 4:      <%= this.S("JTLanguage") %> – <%= this.S(Model.SubMenuItem) %>
Line 5:  </asp:Content>

The page header is:

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TextViewData>" %>

It seems that it can’t find my model class (TextViewData), though it’s namespace is referenced in the namespaces list in the"Web.config file.

If it right-click on "Model" and select "Go to definition", it brings up the non-generic ViewPage class, and not the generic version.

Any ideas on how to fix this?

Thanks.

-John

Upgrading from MVC 4.0.0.1 to 5.2.2.0 seems to have fixed it.  I initially resisted upgrading as I thought it would require lots of changes to my 100′s of views, but apparently not.  See

https://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2

[RESOLVED]Valid XHTML generation

Hi,

On most websites generated by VisualStudio, the generated XTML is invalid. For instance:

http://pse.kaust.edu.sa/our-people/Pages/faculty.aspx

Shows 54 errors :

http://validator.w3.org/check?uri=http%3A%2F%2Fpse.kaust.edu.sa%2Four-people%2FPages%2Ffaculty.aspx&charset=%28detect+automatically%29&doctype=Inline&group=0

Some tags, like "menu" or "ie:menu" are present in the generated XHTML file, which do not exist in the XHTML specifications.

Please advise me on how to build valid HTML websites with VisualStudio or other Microsoft products.

Thanks in advance.

I don’t think it is reasonable to hold Visual Studio responsible for what someone chooses to do with it. If you can show for example that the VS HTML or XHTML templates are invalid, then perhaps someone might take that seriously.

First, you are using a document type that was created in the late 1990′s. Things have changed a lot since then. This isn’t even a recent XHTML doctype. A number of these errors just have to do with where things are. example: an input element that isn’t in
a container like a <p>. That’s a design choice and nothing to do with VS. The bulk of the rest is for webparts. I rarely if ever see wwebparts used for anything outside an intranet environment where they help serve line of business applications. Correct some
of the placement issues for input elements, this is easily accomplished. Don’t use webparts if you don’t need to. Switch to a current HTML dtd.  A number of these errors are not from VS generated code and are simple human error (missing quotes around attributes
for example).

Also, see if you can use bundling and minification. It will greatly enhance the performance of your page. There are a total of 41 requests being made with the page and I count a dozen scripts that could be bundled together and speed up the site (and improve
server performance avoiding extra requests).

Hi LIAR,

For your issue,i suggest that you can try the link below about XHTML Standards in Visual Studio and ASP.NET :

http://msdn.microsoft.com/en-us/library/vstudio/exc57y7e(v=vs.100).aspx

Best Regards,

Kevin Shen.

[RESOLVED]Migrate from Web Matrix to Visual Studio 2013

SQL programmer just getting into web-based development.

Wrote a basic CRUD web app using Web Matrix with the understanding that it would run under Visual Studio.

Launched Visual Studio & got numerous error messages when I tried to run the app – mostly of the type "… Are you missing a reference?".

Read a post here that seemed to imply that I might need to manually add "Using …" statements to include libraries that Web Matrix automatically includes, but that VS doesn’t.

As one of my errors was on a line that included a String.IsNullorEmpty() call, I tried adding "@using System.String;" to the top of my code page.

This resulted in the addition of 6 warnings of the type " … has dependencies on a version of .Net Framework that is higher than the target…"

My question: is there documentation somewhere that details the steps needed to accomplish a successful migration from Web Matrix 3 into VS 2013 for Web?

WebMatrix runs under Visual Studion, without a hiccup.

There are some benefits of having both WM and VS working together, for instance in a multiple monitor environment. My suggestion is to figure out what went wrong.

Created a new site from the WM startersite template and create a test environment.  Open it in VS from WM.

EvanFlink

is there documentation somewhere that details the steps needed to accomplish a successful migration from Web Matrix 3 into VS 2013 for Web?

You should just use the File » Open » Web Site option in Visual Studio, navigate to your WebMatrix app and Bob’s your uncle. From what you describe, you must have taken a different approach to cause so many issues.

Hi Mike,

Well Robert would appear to be my father’s least-liked brother, as he’s giving me all kinds of trouble.
Laughing

A screenshot or image attachment would be better, but here’s a mockup up of the problem as it appears while in VS 2013.

code from my cshtml file:

if(String.IsNullOrEmpty(Co.CO_Abbrev_Name))
            { return Co.CO_Name; }

error message in VS 2013 reads as follows:

"One or more types required to compile a dynamic expression cannot be found. Are you missing a reference?"

This same message appears when I hover the cursor over the keyword ‘String’ in the code above. When I click on ‘Goto Definition (F12)’ in the right-click menu, it shows me namespace System in mscorlib.dll. Do I have to somehow manually include this dll for
my app to compile?

Just not familiar enough with the process to know what to do next.

Thanks

Since you’re saying, you’re a SQL developer and getting into the web-development. Let me tell you, ASP.NET is based on C# (VB.NET version is also allowed, Visual C++ might also be an option, since .NET framework can be programmed using Visual C++; but is
very rare). So, these evers are generally coming out from the C#. 

A reference in C# is a declaration to include the Assembly file. As you’re saying the posts tell you to include the files, using a "Using" statement they’re right! Then you get into another problem. So, I would ask you to stop here! And go to the MSDN documentations
for the C#. Since ASP.NET is based on C# (sorry for saying this sentence again), you can learn the C# itself and then ASP.NET won’t cause any trouble to you.

However, the basic assemblies, are automatically included in the .cshtml files and you don’t have to write the using statements for the commonly used namespaces. There is no tough rule in that file. The one you use in WebMatrix (as found in StarterSite template).
But still you can use that line. But since the Visual Studio has an option for Web Forms, MVC etc, the application you might use, would either be an aspx file or a .cs file where you’re required to stick to the plans and the rules. So these applications might
give you a tough time. 

Going into them would require you to have basic understanding of the C# itself. 

http://msdn.microsoft.com/en-us/library/618ayhy6.aspx (C# Reference)

http://msdn.microsoft.com/en-us/library/aa288436(v=vs.71).aspx (C# Tutorials)

Good luck!

It looks like Co.CO_Abbrev_Name is a dynamic type. Try casting it to a string before attempting any string methods on it:

if(String.IsNullOrEmpty((string)Co.CO_Abbrev_Name))
            { return null; }

Hi Mike,

Keep in mind that all this code worked as expected in the Web Matrix environment. Do I need to do explicit typecasting when working with the same code in VS?

If so that sure limits the portability of the code & makes me wonder what the point of supporting Web Pages in VS might be.

Next – is there a way to attach screenshots to these messages? A screenshot of the VS window would sure provide more (hopefully helpful) info than my manual synopsis, and might make obvious what the problem actually is.

Thanks again to you and the other responders.

Yes, just attach the images from the editor. It is alongwith the Big Yellow smiley. That would be a good thing to share. You might need to upload your image on some image storage service provider and then post the link to that image too. 

Hi Afzaal,

Thanks for your replies. I have some familiarity with C# (and some with Java, which works similarly) but would still consider myself something of a novice with C#.

I took you advice & signed up with an image hosting service & so have provided a screenshot of code & error messages. This code builds & works fine in the Web Matrix environment. I don’t remember if I checked to see what the return type was when I wrote
it, but the function works so I’m assuming that the type is string.

Note that the last error message was based on my wild guess that I needed to add an ‘include System.String’ directive. That has been removed now.

Any comments or input based on what you can see?

 Screenshot of Web Matrix Project in VS 2013 Express for Web environment

edit: hmm – I see the image description, but not the actual image.

2nd edit: change from image to link – at least you can see the screenie now.

Does the code still work in WebMatrix?

Yes it does – just fired it up & ran it.

To address your earlier comment more directly – I launched VS by clicking the ‘Launch’ button on the Home ribbon of WM.

When I tried opening the project using File – Open Web Site, VS says (paraphrased) " the site localhost:44861 is using a newer version of .Net (4.0). The project is targeting ASP.NET2.0; if not configured some features may make incorrect assumptions …. 
Would you like the site to be configured for use with ASP.NET 2.0?"

I answered ‘No’ and am now getting additional error messages like this:

Error    4    Feature ‘implicitly typed local variable’ cannot be used because it is not part of the ISO-2 C# language specification    c:UsersEvanDesktopDDC_Inc_WebformApp_CodeDDCHelpers.cshtml    54    9    DDC_Inc_Webform

In WM, under Site-Settings – Select .Net Framework Version – it says .Net 4 (Integrated), & under ASP.Net Web Pages it says: 2.0.30506.0 Version is up to date.

Is this a problem?

Can you clarify what version of VS you are using?

Installed this in approx. June 2014 (ie, a couple of months ago)

From the ‘About’ dialog:

Microsoft Visual Studio Express 2013 for Web
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.50938

Installed Version: WD Express

Team Explorer for Visual Studio 2013   06156-004-0437007-02394
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06156-004-0437007-02394
Microsoft Visual Basic 2013

Visual C# 2013   06156-004-0437007-02394
Microsoft Visual C# 2013

ASP.NET and Web Tools   2013.2.50425
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Windows Azure Web Sites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Windows Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.1.20409.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.1
Provides common services for use by Azure Mobile Services and Windows Azure Tools.

NuGet Package Manager   2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   12.0.30919.1
Microsoft SQL Server Data Tools

What I would do under the circumstances is to create a new site using the Empty Site template, and then keep only the web.config file (and anything in the bin folder). Then copy across all of your existing code. You can use File Explorer to copy the existing
files across. Make sure it runs in WM then try opening that directly from within VS.

Alright – will give that a try

Thanks Mike – that, in typical "roll it up the hill & see if does it again" fashion, worked.

Created a new empty site, re-connected my databases, added in js, css, images, shared & index pages, testing as I went, then finally said screw it & dumped all remaining pages in due to the tediousness.

Built on first try & ran! Nice part was that, in VS, I found a couple of unrelated errors.

Thanks much & thanks also for your web site, which I have referred to, & got good info from, several times while working on this project.

Best Regards

[RESOLVED]razor @functions in a separate file not working – debugger can't see file

When I put @Functions block in a separate vbhtml file in the App_Code directory using visual studio express for web 2013, the debugger doesn’t recognize the file so can’t see it. The @functions block is fine when in the same file from which I call it. I’ve
tried building the website using the debugger but that makes no difference – still can’t see it.

What am I missing? Is there some special syntax I need in the separate vbhtml file? I created a separate helpers file and that was fine but I seem to have a problem with functions. The IDE says its using Razor v2, if that’s of any relevance.

Any help greatly appreciated

Jim

I’m not clear what you mean by "can’t see file". If you place your functions or helpers file in App_Code, you have to prefix the helper or function with the name of the file – minus the extension – when you reference the function or helper in another file.
So if you create a function called Print() and you put it in a file called Functions.vbhtml and then place that in App_Code, you will call it in another vbhtml file like this:

@Functions.Print()

Many thanks for your reply

I have the function in the file test78.vbhtnl in the App_Code directory. Calling a function in the @Functions code block elicits the following error:

Error 26 ‘test78′ is not declared. It may be inaccessible due to its protection level.

It doesn’t seem to recognize the file as far as I can see…..I have now run the file and the function is called correctly but I still get the same debug error if I build the website. Weirdly if I create a new empty vbhtml file and copy the functions into
it, I get no error. The only possible diffference is that the original file that is causing the error may have originally been created as a helper file (when selecting a new file option from the menu). I just got rid of the @Helpers code and replaced it with
the @Functions. Seeing these are just text files, I thought it wouldn’t make any difference. Maybe visual studio keeps a record of the types created somewhere?

Intellisense can be a little peculiar with VB sometimes. As to the different file types, there is no difference. They are both .vbhtml files, but are generated from a different template. However, I have been able to replicate the error you reported. I suspect
that’s an issue with the VB compiler/VS combination.

Good to know I not going completely mad! I guess it’s good to have this error documented out there somewhere. A little less hair may get pulled out as a result. Thanks for giving it your attention

Jim

[RESOLVED]menu when button hover

Hi

I have a share image button in my website and what i looking for is when user move the mouse on the image a small menu appear, can any one help me with it or refer me to a good online tutorial 

Many thanks 

Hi,

Take a look at this video:

https://www.youtube.com/watch?v=lx0IysyYLH0,

Have fun

Hi msimo.

For your issue,i wrote a demo for you:

When mouse on the image,it will show the menu,when mouse leave the image,it will hide the menu.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#test").mouseenter(function () {
               $("#menu").show();
            
            })
            $("#test").mouseleave(function () {
                $("#menu").hide();

            })
           
        })
    </script>
</head>
<body>
    <ul>
        <li>   
            <img src="xx" id="test" />
            <ul id="menu" style="display:none">
                <li>A</li>
                <li>B</li>
                <li>C</li>
            </ul>
        </li>
    </ul>
    
</body>
</html>

Best Regards,

Kevin Shen.

knockout js is working on main window but not working in popup window on asp.net / vb.net web application

Hello

I am developing a web application built with asp.net and vb.net

I have a page (update_status.aspx) which is using knockout js to display a datepicker depending upon the value selected by the user on select box. the code is like below.

 <%@ Page Title="" Language="VB" MasterPageFile="E4.master" AutoEventWireup="false" CodeFile="update-status.aspx.vb" Inherits="E4_Jobs_Details_Application_update_status" %>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">

           <div class="entry-wrapper">
                <input type="hidden" id="appId" value="<%= VacancyApplication.ID%>" />

                <div class="form-element">
                    <label>Current status</label>
                    <input type="text" readonly="readonly" value="<%= VacancyApplication.Status%>" />
                </div>

                <div class="form-element">
                    <label>New status (required)</label>
                    <select id="comNewStatus" runat="server" datavaluefield="id" datatextfield="name" class="nFee"></select>
                </div>


                <div data-bind="visible: statusId() == 12">
                    <label>
                        Start date (required, format: DD-MMM-YYYY)
                    </label>
                    <div class="input-append">
                        <span class="add-on "><span class="icon-calendar"></span></span>
                        <input class="dp" size="16" type="text" value="" runat="server" id="txtStartDate" />
                    </div>
                </div>
            </div>


</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ScriptContent" runat="Server">
    <script  src="~/_resx/js/jquery-1.8.3.min.js"></script>
    <script src="~/_resx/js/json2.min.js"></script>
    <script src="~/_resx/js/knockout-2.2.1.js"></script>
    <script src="~/_resx/js/knockout.mapping-latest.js"></script>

    <script type="text/javascript">

        var ViewModel = function () {
            var self = this;
            self.histories = ko.observableArray([]);
            self.statusId = ko.observable(0);
            self.feeType = ko.observable(0);
            self.agencyApp = ko.observable(false);
            self.offeredSalary = ko.observable(0);
            self.finalSalary = ko.observable(0);
            self.introductionFee = ko.observable(0);
            
        };
        var vm = new ViewModel();
        ko.applyBindings(vm);

        $(function () {
            $("select.chosen").chosen();
            dimNav('vacancy');

            var aid = $('#appId').val(), feeType = $('#feeType').val(), agencyApp = $('#agencyApp').val();
            vm.feeType(parseInt(feeType));
            vm.agencyApp(agencyApp);

            $('.nFee').change(function () {
                vm.statusId(parseInt($(this).val()));
            });
            

            //numeric only
            $('.txtOfferedSalary, .txtFinalIntroductionFee,.txtFinalSalary').keydown( function(event) {
                // Allow: backspace, delete, tab, escape, and enter
                if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 ||
                    (event.keyCode == 65 && event.ctrlKey === true) ||
                    // Allow: home, end, left, right
                    (event.keyCode >= 35 && event.keyCode <= 39)) {
                    return;
                } else {

                    if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) {
                        event.preventDefault();
                    }
                }
            });



            $.when(
                $.ajax({
                    type: "POST",
                    url: "/_services/UtilityService.asmx/applicationstatushistories",
                    data: "{id:" + aid + "}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    cache: true
                })).done(function (r) {
                    vm.histories($.parseJSON(r.d));
                    //console.log();
                    momentize();
                });
        });
    </script>
</asp:Content>

The problem is this knockoutjs doesnot work when i convert this page as popup page by changing its master page (like below). that is the calender doesnot come up when user selects the right status.

<%@ Page Title="" Language="VB" MasterPageFile="E4_Popup.master" AutoEventWireup="false" CodeFile="update-status.aspx.vb" Inherits="E4_Jobs_Details_Application_update_status" %>

Both E4.master and E4_Popup.master is using the same style and same code file .

<%@ Master Language="VB" CodeFile="E4.master.vb" Inherits="_resx_E4" %>

the only difference is they are different files and E4_Popup.master doesnot contains the extra bits of the web page (e.g; headers and footers ).

even if copy E4.master page as E4_Popup.master page and refer it to the update status page .. the calender does not come up. It just not working on the pages other than E4.master page.

I dont understand what the problem is..

What shall I do? Please help me with right advice. 

If you need more information please let me know.

Hi,

make sure the new master page file refers to the knockout.js file from its header too.

I had make sure of that… even if i just copy the E4.master page and save it as E4_Popup.master page and refere it to update_status.aspx page that doesnot work.

raju dasa

Hi,

make sure the new master page file refers to the knockout.js file from its header too.

Hi bashabi,

In your code,i didn’t see any javascipt reference code about knockout.js

please make sure that you have code like below in your page:

  <script src="../Scripts/knockout.js"></script>

Best Regards,

Kevin Shen.

the references are in master page.  i also have added the reference in main page…. but it did not work.

I have included the codes for both the master pages.

below is the code for my master page for popup . please have a look. and advice me

<%@ Master Language="VB" CodeFile="E4_Popup.master.vb" Inherits="_resx_E4_Popup" %>


<!doctype html>

<html lang="en">
<head id="Head1" runat="server">

    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">
    <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,100' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" media="screen" href="/_resx/css/e4-popup-min.css" />
    <link rel="stylesheet" type="text/css" media="screen" href="/_resx/css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" media="print" href="/_resx/css/e4_print_1.css" />
    <script  src="/_resx/js/jquery-1.8.3.min.js"></script>
    <script src="/_resx/js/json2.min.js"></script>
    <script src="/_resx/js/knockout-2.2.1.js"></script>
    <script src="/_resx/js/knockout.mapping-latest.js"></script>

    <script type="text/javascript">if ($.browser.msie && parseInt($.browser.version) < 8) { window.location = '/badbrowser.aspx'; }</script>
    <script>
        $(function () {
            if ($.browser.msie && parseInt($.browser.version, 10) === 6) {
                $('.row div[class^="span"]:last-child').addClass("last-child"); $('[class*="span"]').addClass("margin-left-20"); $(':button[class="btn"], :reset[class="btn"], :submit[class="btn"], input[type="button"]').addClass("button-reset"); $(":checkbox").addClass("input-checkbox"); $('[class^="icon-"], [class*=" icon-"]').addClass("icon-sprite");
                $(".pagination li:first-child a").addClass("pagination-first-child");
            }
        })
    </script>

     
</head>
<body>
    <form id="form1" runat="server">
      <asp:ScriptManager runat="server" ID="ScriptManager" />
        <div class="loading"></div>
        <div class="popup-wrapper">

            <asp:ContentPlaceHolder runat="server" ID="MainContent" />
        </div>
    </form>
    <script src="https://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="https://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script src="/_resx/js/respond.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBUCn2Ql9C5kHJbIxYgghwA3Q5zmoTahIk&sensor=true"></script>
    <script src="/_resx/js/json2.min.js"></script>
    <script src="/_resx/js/knockout-2.2.1.js"></script>
    <script src="/_resx/js/knockout.mapping-latest.js"></script>
    <script src="/_resx/js/bootstrap.min.js"></script>
    <script src="/_resx/js/bootbox.min.js"></script>
    <script src="/_resx/js/typeahead.min.js"></script>
    <script src="/_resx/js/trunk8.js"></script>
    <script src="/_resx/js/moment.js"></script>
    <script src="/_resx/js/chosen.jquery.min.js"></script>
    <script src="/_resx/js/jquery.cookie.js"></script>
    <script src="/_resx/js/date.format.js"></script>
    <script src="/_resx/js/jquery-datepicker.min.js"></script>
    <script src="/_resx/js/highcharts.js"></script>
    <script src="/_resx/js/spinners.min.js"></script>
    <script src="/_resx/js/tipped.js"></script>
    <script src="/_resx/js/datepicker.js"></script>
    <script src="/_resx/js/jquery.autosize-min.js"></script>
    <script src="/_resx/js/jquery.tinysort.min.js"></script>
    <script src="/_resx/js/jquery.mousewheel.js"></script>
    <script src="/_resx/js/jquery.jscrollpane.js"></script>
    <script src="/_resx/js/jquery.gmap.js"></script>
    <script src="/_resx/js/jquery.signalR-1.0.1.min.js"></script>
    <script src="/signalr/hubs"></script>
    <script src="/_resx/js/e5-min.js"></script>


    <asp:ContentPlaceHolder runat="server" ID="ScriptContent" />
    <script type="text/javascript">
                function setSize() {
                        window.resizeTo(300, 300);
                }

                function SetWindow() {
                            var height = 400                      //Set height
                            var width = 400                        //Set width
                            var name = "winname"             //Set window name
                            var top = 20                             //Set distance from top
                            var left = 20                             //Set distance from bottom
                            url = window.location.href;
                            window.document.statusbar.enable = false;

                            if (document.location.search == '') {
                                newwin = window.open(url, name, "fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no,width=" + width + ",height=" + height + ",left=" + left + ",top=" + top);

                            }
                }


                var reseizeParentColorBox = function () {
                    parent.$.colorbox.resize({
                        innerHeight: $('body').height() + 100
                    });

                    $('input[type="text"]:first').focus();
                };

                //momentise times

                var momentize = function () {
                    $('.moment').each(function () {
                        var m = moment($(this).attr('data-time'));
                        var $time = m.valueOf();
                        if (m.diff(moment(), 'days') < 0) {
                            $(this).removeAttr('rel').html(moment($time).format('MMMM Do, YYYY'));
                        } else {
                            $(this).html(moment($time).fromNow()).attr({
                                'title': moment($time).format('MMMM Do, YYYY h:mm a')
                            });
                        }
                    });
                };

                function loaderStart() {
                    $('.loading').show();
                }

                function loaderStop() {
                    $('.loading').fadeOut();
                }



        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-31876528-1']);
        _gaq.push(['_trackPageview']);



        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>
</body>
</html>

below is my code for master page for main screen

<%@ Master Language="VB" CodeFile="E4.master.vb" Inherits="_resx_E4" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head runat="server">
    <title></title>
    <meta name="robots" content="noindex, nofollow">
    <meta name="googlebot" content="noindex, nofollow">
     <link href='https://fonts.googleapis.com/css?family=Roboto:400,300,100' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="/_resx/css/e5-min.css" />

    <link rel="stylesheet" type="text/css" media="print" href="/_resx/css/e4_print_1.css" />
    <script src="/_resx/js/jquery-1.8.3.min.js"></script>
  
    <script type="text/javascript">if ($.browser.msie && parseInt($.browser.version) < 8) { window.location = '/badbrowser.aspx'; }</script>
    <script>
        $(function () {
            if ($.browser.msie && parseInt($.browser.version, 10) === 6) {
                $('.row div[class^="span"]:last-child').addClass("last-child"); $('[class*="span"]').addClass("margin-left-20"); $(':button[class="btn"], :reset[class="btn"], :submit[class="btn"], input[type="button"]').addClass("button-reset"); $(":checkbox").addClass("input-checkbox"); $('[class^="icon-"], [class*=" icon-"]').addClass("icon-sprite");
                $(".pagination li:first-child a").addClass("pagination-first-child");
            }
        })
    </script>

</head>
<body>
    <form id="form1" runat="server" style="height: 100%;">
        <asp:ScriptManager runat="server" ID="ScriptManager" />
        <div class="loading"></div>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="navbar-search pull-left q-search">
                    <input type="text" id="qSearch" placeholder="type job title or candidate name..." />
                    <input type="hidden" value="" id="qSearchU" />
                </div>
                <ul class="nav pull-right account">
                    <li class="user  dropdown">
                            <div class="user">
                                <%= LocalHelper.CurrentUserName()%> <b class="caret"></b>
                            </div>

                    </li>
                </ul>

                               <a class="pull-right logout" href="/logout.aspx">Log out</a>
            </div>
        </div>

        <div class="help">
            <div class="help-inner">
                <iframe id="helpframe" src="/E4/help/index.html" scrolling="no" frameborder="0" height="auto" width="100%">Sorry, iframes are not supported.</iframe>
            </div>
        </div>

         <div class="g-wrapper">
                            <a href="#menu" id="menuLink" class="pure-menu-link">
                                        <img src="/_resx/images/navicon-png2x.png" width="20" alt="Menu toggle">
                            </a>
                            <div class="fix-nav-bg scroller">
                                        <div class="fix-nav">
                                                    <a class="nav-link " href="/E4/Default.aspx">
                                                        <i class="dashboard"></i>
                                                        <span>Dashboard</span>
                                                    </a>
                                                    <a class="nav-link " href="/E4/Jobs/Open.aspx">
                                                        <i class="vacancy"></i>
                                                        <span>Jobs</span>
                                                    </a>
                                        </div>
                            </div>
                            <asp:ContentPlaceHolder runat="server" ID="MainContent" />
        </div>
        <a href="http://mypeoplebiz.com" class="copy">&copy; mypeoplebiz</a>
    </form>

    <script src="/_resx/js/respond.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
    <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBUCn2Ql9C5kHJbIxYgghwA3Q5zmoTahIk&sensor=true"></script>


    <script src="/_resx/js/json2.min.js"></script>
    <script src="/_resx/js/knockout-2.2.1.js"></script>
    <script src="/_resx/js/knockout.mapping-latest.js"></script>
    <script src="/_resx/js/bootstrap.min.js"></script>
    <script src="/_resx/js/bootbox.min.js"></script>
    <script src="/_resx/js/typeahead.min.js"></script>
    <script src="/_resx/js/trunk8.js"></script>
    <script src="/_resx/js/moment.js"></script>
    <script src="/_resx/js/chosen.jquery.min.js"></script>
    <script src="/_resx/js/jquery.cookie.js"></script>
    <script src="/_resx/js/date.format.js"></script>
    <script src="/_resx/js/jquery-datepicker.min.js"></script>
    <script src="/_resx/js/highcharts.js"></script>
    <script src="/_resx/js/spinners.min.js"></script>
    <script src="/_resx/js/tipped.js"></script>
    <script src="/_resx/js/datepicker.js"></script>
    <script src="/_resx/js/jquery.autosize-min.js"></script>
    <script src="/_resx/js/jquery.tinysort.min.js"></script>
    <script src="/_resx/js/jquery.mousewheel.js"></script>
    <script src="/_resx/js/jquery.jscrollpane.js"></script>
    <script src="/_resx/js/jquery.gmap.js"></script>
    <script src="/_resx/js/jquery.signalR-1.0.1.min.js"></script>
    <script src="/signalr/hubs"></script>
    <script src="/_resx/js/e5-min.js"></script>
    <asp:ContentPlaceHolder runat="server" ID="ScriptContent" />
    <script type="text/javascript">

        function openSupport() {

            var URL = '/E4/help/index.html';
            window.open(URL, '', 'toolbar=0,scrollbars=0,location=no,statusbar=0,menubar=0,resizable=1,width=900,height=700,left = 560,top = 130');

        }



        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', 'UA-31876528-1']);
        _gaq.push(['_trackPageview']);

        (function () {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();

    </script>
</body>
</html>

Hi bashabi,

I suggest that you can use F12 to debug your page ,see if it has any error message.

If does,please post here.

Best Regards,

Kevin Shen.

There are 2 error message which I have found in the popup page but not in main page while debugging. I have provided them including the code (where it indicated the error) below. 

these codes are written in both of the two master page. 

I have tried disabling these lines of code and run… but its the same result.

please have a look and advice

SCRIPT5007: Unable to get property ‘msie’ of undefined or null reference
update-status_popup.aspx, line 17 character 13

    <script>
        $(function () {
            if ($.browser.msie && parseInt($.browser.version, 10) === 6) {
                $('.row div[class^="span"]:last-child').addClass("last-child"); $('[class*="span"]').addClass("margin-left-20"); $(':button[class="btn"], :reset[class="btn"], :submit[class="btn"], input[type="button"]').addClass("button-reset"); $(":checkbox").addClass("input-checkbox"); $('[class^="icon-"], [class*=" icon-"]').addClass("icon-sprite");
                $(".pagination li:first-child a").addClass("pagination-first-child");
            }
        })
    </script>

SCRIPT5007: Unable to get property ‘resize’ of undefined or null reference
update-status_popup.aspx, line 304 character 21

                var reseizeParentColorBox = function () {
                    parent.$.colorbox.resize({
                        innerHeight: $('body').height() + 100
                    });

                    $('input[type="text"]:first').focus();
                };

When I run the application … for the E4.master page,E4_popup.master page and update_status_popup.aspx page the following type of warning comes up

Namespace or type specified in the Imports ‘Telerik.WebControls’ doesn’t contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn’t
use any aliases.

[RESOLVED]error passing the query

Kindly help me with the below error.

Server Error in ‘/’ Application.


There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = Order ]

Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlServerCe.SqlCeException: There was an error parsing the query. [ Token line number = 1,Token line offset = 27,Token in error = Order ]

Source Error:

Line 7:      var commandText = "UPDATE HomePageBanner SET Order = @0 WHERE Id = @1";
Line 8:      foreach (var menuItemId in menuItemIds.Split(new[] { ',' })) {
Line 9:          db.Execute(commandText, displayOrder, menuItemId);
Line 10:         displayOrder ++;
Line 11:     }


Source File: c:My Web SitesWebPagesCMS(7) – pharmaAdminAjaxUpdateHomePageSliderItemOrder.cshtml    Line:
9

Hi,

I think, Order field need to be escaped, try updating like this:

SET [Order] = @0

[RESOLVED]__doPostBack fails. Only in Safari on a Mac without Developer Menu visible

I have a perplexing problem. The following fails

__doPostBack(‘ctl00$c$hiddenSubmit’,”);

ONLY on a Mac, using Safari. AND ONLY if the Develop menu isn’t visible.

The error is

TypeError: ‘Undefined’ is not an object (evaluating ‘caller.arguments.callee’)

As already stated, this works in all other browsers. When the error occurs in Safari, the obvious troubleshooting approach is to turn on the developer tools. But, as soon as the Develop menu option is displayed, the problem goes away.

It works on Windows in IE, Chrome, Safari, etc. It works in Mac Safari, when the Develop menu is displayed.

I can’t test other browsers on the Mac, so assume it may just be Safari.

Difficult to say what the problem could be but here are few things you could try:

Install safari on windows and see if the problem still happens.

If it works with developer tools open, it might be there’s a timing issue happening. I’ve had instances every so often where opening a developer tool (e.g. firebug) stopped the error happening. I think what happens is the developer tool might slow things
down very slightly but long enough for an undefined object to be defined (if that makes sense). This is typical where you use asynchronous calls and have accidentally referenced data that you are waiting for in your asynchronous response before the data is
returned. Sometimes opening a debugging windows allows that call to be made in time and the problem goes away.

Also – try creating a copy of the page you;re working on but only include the absolute basics – and then add your components/code bit by bit until you hit the error again – at least that way you might be able to locate where the error is happening.

Are you doing anything complicated on the front-end? Are you dynamically loading javascript files? Are you loading data asynchronously?

Thanks for the reply loydall123

I now have a solution, which is more workaround than solution. Instead of calling __DoPostBack, I’m calling the .click(). The problem has gone away.

In reply to your questions, in case anyone else has a similar problem:

It works fine on Safari on Windows.

I thought it might have been a timing issue, so had tried adding a delay before calling. No success, but then I didn’t explore this path heavily.

There maybe some front-end complexity, depending on what your call complex. There’s an iframe involved. A script in the parent page runs, and after a number of steps calls a function in the iframe page. Domains have been set correctly, and the function call
definitely succeeds. The function validates some data (successfully) and call __DoPostBack(….) via javascript generated by 

Page.ClientScript.GetPostBackEventReference(hiddenSubmit,"")

That’s where the problem occurs.

My gut feel is the problem could be due to the iframe. The .Net code inside __DoPostBack loops upwards via caller.arguments.callee. I have a sneaking suspicion it’s getting to the first call in the iframe, tries to access the caller and
has a problem getting to the parent page. But, only in Safari on a Mac, with the Develop menu hidden.

Anyway, it now works.

Thanks again.