Category Archives: Panel

Panel

[RESOLVED]Please confirm this resolution for a security exception due to the trust level when hosting MVC5 on GoDaddy

Hello,

VS2013 update 3, MVC5

When I deployed without modification the standard MVC5 template to GoDaddy I immediately received a security exception.  The security exception basically indicated the environment’s security policy didn’t allow "…ReflectionPermission", which MVC5 evidently
wants to use.

My initial research revealed a lot of posts stating many hosting providers only offer "medium trust" and that would be a show stopper for an MVC5 site.  I eventually found a Stack Overflow post where an individual using GoDaddy simply added the following
line to web.config:

  <system.web>
    ...
    <trust level="Full" />
  </system.web>

This worked, at least for now.  So these are my questions, and if there seem to be other appropriate comments to add, please do so.

1) Is it true that without "full trust" MVC5 cannot effectively be used?

2) Were most of the posts suggesting many hosting providers wouldn’t provide full trust simply a reflection of a changing industry environment?

3) Can we reasonably expect that higher tier hosting providers will support trust levels required for effective MVC5 use?

4) Since I was able to add <"trust level = "Full"/> without getting an error from the hosting provider AND the MVC5 site loaded OK (remember it’s just the default template), can I reasonably expect I won’t run into trust level problems going forward?

I will add for others who may read this thread, I had zero problems deploying to Azure.

Best Regards,

Alan

 

Hi Alan,

Most of hosting provider offer FULL Trust hosting now. As I know, godaddy doesnt offer for Full Trust. You may check it with them. For above issue, it is truly the permission issue. If you require full trust hosting, you can find it on
Microsoft spotlight site, for example asphostportal

If the target is shared hosting, it will be safer to believe in medium trust.

http://www.4guysfromrolla.com/articles/100307-1.aspx

Hi cnranasinghe and Carl,

Carl, I will reach out to GoDaddy.  I am confused because I added the "Full" trust line in my web.config and the hosting server didn’t complain.  I assumed that meant I have "Full" trust.  Maybe not.  I’ll probably post an addendum here after I find out. 
It is odd that the MVC5 site didn’t run without the explicit "Full" trust line, because the spec says the trust level defaults to "Full".  So if I added "Full" to my web.config, I was just defining what already was the default.  Why would that have been necessary?

cnranasinghe, That was a great link to understand the implications.  Thanks!  Can you confirm what I think I read?

It seems as though MVC5 may run in "Medium" trust, but certain methods may not operate if they or their class require "Full", and the only way to really know that is to set "Medium" trust in the development environment and see what works?  Or is there an
easier way to know?

Thanks,

Best Regards,

Alan

Hi Carl,

Thought you and others would be interested to know that GoDaddy does in fact support Full Trust on their shared hosting servers.  Historically this has changed back and forth since ASP.NET 2.0, so that probably explains why there is some confusion over what
is available with GoDaddy.  Additionally, not every one of their support agents is fully aware of this nuance, but it is available.

There are 2 ways to engage Full Trust on GoDaddy.  Web.config can be modified as shown above.  Without that line in web.config, the default of Medium Trust will be applied. 

Alternatively, there is a webpage for each website that permits manual setting for a variety of ASP.NET parameters (at the time of writing this post, the User Interface doesn’t default to show the menus/additional webpages and you have to expand the menu
panel by clicking on the ‘Show More’ tab).   Once on the ASP.NET Settings Page there is a drop down box (currently called Code Access Security) that allows setting the Trust for that particular website (This is where the default Trust setting is set, but only
for that website).  If Full Trust is selected there, then the line in web.config will not be needed.  Interestingly, if web.config has that line, then the web page will change to reflect what’s in web.config.

Best Regards,

Alan

[RESOLVED]Using col-sm & col-xs without specifying the senario for the large screen

I have the following code inside a web template that i am using :-

</div>
<div class="row panel">
<div class="col-sm-3 hidden-xs">
@Html.Action("Menu", "Nav")
</div>
<div class="col-xs-12 col-sm-8">
@RenderBody()
</div>
</div>

but now i got confused on how the two divs will display in a full screen (large screen), as i understand the markup as follow:-

- the Menu will be hidden on X-small screens and occupy 3 columns on small size,, but what about large screens ?

- the RenderBoy will occupy 12 in x-small screens and 8 in small but what about large screens ?

Can anyone advice ?

Thanks

if you look at the break points in the documentation for Bootstrap it shows that the classes "cascade" up so if you only set the col-sm-8 it is also then col-md-8 and col-lg-8 without specifying it.

http://getbootstrap.com/css/

hope it helps

Hi john,

First, please refer to remojr76’s reply

Secondly, base on http://getbootstrap.com/css/#grid, it says that:

•Grid classes apply to devices with screen widths greater than or equal to the breakpoint sizes, and override grid classes targeted at smaller devices. Therefore, applying any .col-md- class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg- class is not present.

Best Regards

Starain Chen

[RESOLVED]multiple search option with cascading dropdown and MVC.Paging

how can i use multiple search options to get number of paged records

multiple search option like country ,state ,city ,gender, and etc…

here i created a controller browseallmemmbers where search criteria is working 

private const int defaultPageSize = 10;
       
        private IList<Profile> getAllmembers = new List<Profile>();
        public ActionResult BrouseAllMem(int? page, long? stateid, long? countryid,long? cityid)
        {

            int currentPageIndex = page.HasValue ? page.Value : 1;

            ViewData["countryid"] = countryid;
            ViewData["Stateid"] = stateid ;
            ViewData["cityid"] = cityid ;
           
            IList<Profile> members = this.getAllmembers;

           
            IQueryable<Profile> mm = db.Profiles.OrderByDescending(c => c.pid);
            if (countryid > 0)
            {
                
                mm = mm.Where(p => p.countryid == countryid);
            }
            if (stateid > 0)
            {
                mm = mm.Where(p => p.stateid == stateid);
            }
            if (cityid > 0)
            {
                mm = mm.Where(p => p.cityid  == cityid);
            }

           
            members = mm.OrderByDescending(p => p.pid).ToPagedList(currentPageIndex, defaultPageSize);
 
            ViewBag.cityid = new SelectList(db.citytables, "cityid", "cityname", ViewData["cityid"]);
            ViewBag.countryid = new SelectList(db.Countries, "COUNTRYID", "countryname", ViewData["countryid"]);
            ViewBag.stateid = new SelectList(db.states, "stateid", "statename", ViewData["stateid"]);
                      
            return View(members);
        }

View where result is displaying

@*@model IEnumerable<LovNMarProj.Models.Profile>*@
@using MvcPaging
@model IPagedList<LovNMarProj.Models.Profile>
@{
    ViewBag.Title = "BrouseAllMem";
    Layout = "~/Views/Shared/_LayoutTEM.cshtml";
}
@using (Html.BeginForm("BrouseAllMem", "Home", FormMethod.Get))
{
<div class="page-header">
    <div class="panel panel-default">
        <div class="panel-heading">All Members</div>
        <div class="panel-body">
            <div class="col-sm-3 col-md-3 pull-left">
                <div class="input-group input-group-sm">
                    @*<input class="form-control" id="appendedInputButton" type="text" name="member_name" placeholder="Name" value="@ViewData["member_name"]" />*@
                   
                </div>
            </div>
            @Html.DropDownList("countryid", ViewBag.countryid as SelectList, "Select a Country", @ViewData["countryid"])

            @Html.DropDownList("stateid",null ,string.Empty , @ViewData["stateid"])

            @Html.DropDownList("cityid",null ,string.Empty , @ViewData["cityid"])

            <div class="col-sm-3 col-md-3 pull-right" >
                <button class="btn" type="submit">
                    <i class="glyphicon glyphicon-search"></i>
                </button>
            </div>
        </div>
        <ul class="list-group">
            
            @foreach (var item in Model)
            {
                var gender = "Female"; if (@item.gender == "M") { gender = "Male"; } 
                var pimage = "no_avatar.gif"; 
                if (@item.photo != null && @item.photo  != "") { pimage = @item.photo ; }
                
                
                
                <li class="list-group-item ">
                    <div class="row">
                        <div class="col-sm-9">
                            <p> <strong>@item.headline</strong></p>
                        </div>
                        <div class="col-lg-3 text-muted text-right small">
                            Joined On: @item.profiledate
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-1">

                            <img src="~/profilepic/@pimage" class="img-thumbnail" />
                        </div>
                        <div class="col-sm-3">
                            <h5>
                                @item.fname
                                &nbsp;
                                @item.lname<small>(@gender)</small>
                            </h5>
                            <p>
                                @item.Country.countryname  -
                                @item.state.statename -
                                @item.citytable.cityname 
                            </p>
                        </div>
                        <div class="col-sm-5">
                            About:<p> @item.whoami</p>
                        </div>
                        <div class="col-sm-3">
                           Looking For:<p> @item.lookingfor</p>
                        </div>
                    </div>








                </li>
            }

        </ul>
        <div class="panel-footer">
            <div class="pager">
                @Html.Raw(Html.Pager(
            new Options
            {
                PageSize = Model.PageSize,
                TotalItemCount = Model.TotalItemCount,
                CurrentPage = Model.PageNumber,
                ItemTexts = new ItemTexts() { Next = "Next", Previous = "Previous" },
                ItemIcon = new ItemIcon() { First = "icon-backward", Previous = "icon-chevron-left", Next = "icon-chevron-right", Last = "icon-forward" },
                TooltipTitles = new TooltipTitles() { Next = "Next page {0}", Previous = "Previous page {0}", Page = "Go to page {0}" },
                Size = Size.normal,
                Alignment = Alignment.centered,
                IsShowControls = true,
                IsShowFirstLast = true,
                IsShowPages = true
            }, new { countryid = ViewData["countryid"], stateid = ViewData["stateid"], cityid = ViewData["cityid"] }))
            </div>

        </div>
    </div>
</div>
}
<script type="text/jscript">
    $(function () {

        $('#countryid').ready(function () {


            //$('#stateid').empty();
            //$('#cityid').empty();

            $.getJSON('/Kas/StateList/' + $('#countryid').val(), function (data) {
                var items = "";
                $.each(data, function (i, stateid) {
                    items += "<option value='" + stateid.Value + "'>" + stateid.Text + "</option>";
                });

                $('#stateid').html(items);
                $('#stateid').trigger("change");

            });
        });



        $('#countryid').change(function () {

            $.getJSON('/Kas/StateList/' + $('#countryid').val(), function (data) {
                var items = '';
                $.each(data, function (i, stateid) {
                    items += "<option value='" + stateid.Value + "'>" + stateid.Text + "</option>";
                });
                $('#stateid').html(items);

            });
        });

        $('#stateid').change(function () {
            $.getJSON('/Kas/Citylist/' + $('#stateid').val(), function (data) {
                var items = '';
                $.each(data, function (i, cityid) {
                    items += "<option value='" + cityid.Value + "'>" + cityid.Text + "</option>";
                });
                $('#cityid').html(items);



            });
        });





    });

</script>

it shows the result properly but if i go to next page search criteria is gone

how to keep search result and paging both

 with one search option its works but with multiple search its not working

Hi pjpatil,

Base on your code, I found that you are using ViewData and ViewBag with same key, which are conflict, in other words, the
ViewData data will be override.

Please use the different key to store current search conditions.

To keep the conditions, you just need to store them as parameters in the URL (Html.PagedListPager), and in the action has the corresponding parameters to get that data.

Best Regards

Starain Chen

[RESOLVED]Load partial view on the right hand side panel of the main view

HI ,

I am having a main view,, which is divided into 2 sections. Leftpanel with links and right panel with a div.

When i click each link in the left side menu it should render the corresponding partial view in the div in the right side panel.

PLease find my code

Main page

@{
    Layout = null;
}
<link href="~/css/Admin.css" rel="stylesheet" />
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ADMIN PAGE</title>
</head>
<body style="background-color:#bfd0e4;">
     <table style="width:100%;height:100%;">
          <tr style="vertical-align:top;">
               <td style="width:60%">
                       <div id="RenderHere">
                         
                    </div>
                  </td>
               <td class="middletd">
                    <img src="./Images/blue_overlay.jpg">
                </td>
                <td style="width:60%">
                    <div>  
                        <table style="height:60%">
                            <tr>
                                <button id="doctors">Doktori</button>
                                <button id="apointments"> Pregledi</button>
                            
                            </tr>
                        </table>             
                    </div>
                 <div class="holidayinn"><img src="./Images/holiday_club_logo.png"></div> 
            </td>
        </tr>
    </table>
</body>
</html>

Here two buttons are there.

I am having a partial view named _branchpartial.Its a partial view which lists some data from the db which again pouplates modal dialogs.

But here when i clcik the first button it should display this partial view(_branchpartial) in the div "RenderHere". And i need to pass the model also.

In the controller i have already written Actionresult and created partial view as follows

public ActionResult Branch()
        {
            model= new TrackerModel();
             // List<BranchModel> filterdBranchData = null; 
              try
              {
                  model.branchData = this.ppiService.GetBranchData();
                 // filterdBranchData = model.branchData.Where(item => item.IsDisabled.Equals(false)).ToList();
               
              }
              catch (Exception ex)
              {
                  logger.Error("error occured", ex);
              }
              return View(model.branchData);
        }

Please help me to find a solution. I need to open the partial view in the div when i click the first button.

Can i use ajax method? if so how?

How can i call the Action "Branch"  from the button?

Thanks,

Vidya

Please take a look at Ajax.ActionLink. It solves your problem

Ajax.ActionLink and Html.ActionLink in MVC  (please scroll to the middle of the page)

[RESOLVED]Not rendering in <>div> after saving from dialog box

Hi,

I am having a main view as follows

@{
    Layout = null;
}
<link rel="stylesheet" href="https://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="~/Scripts/jquery-1.7.1.min.js"></script>
<script src="~/Scripts/jquery-2.1.1.js"></script>
    <script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link href="~/css/Admin.css" rel="stylesheet" />

<script type="text/javascript">  
    $(document).ready(function () {
      
        $('#btnbranch').click(function () {
            
            $("#RenderHere").load("@Url.Action("Branch","Branch")",
                                      function (response, status, xhr) {
                                          if (status == "error") {
                                              alert("An error occurred while loading the results.");
                                          }
                                      });
        });
        
    });
    </script>
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ADMIN PAGE</title>
</head>
<body style="background-color:#bfd0e4;">
     <table style="width:100%;height:100%;" id="tbl">
          <tr style="vertical-align:top;">
               <td style="width:60%">
                       <div id="RenderHere">
                         
                    </div>
                  </td>
               <td class="middletd">
                    <img src="./Images/blue_overlay.jpg">
                </td>
                <td style="width:60%">
                    <div>  
                        <table style="height:60%">
                            <tr>
                                <button id="btnbranch">BRANCH</button>
                                </br>

                                <button id="apointments"> SOURCE</button>
                            
                            </tr>
                        </table>             
                    </div>
                 <div class="holidayinn"><img src="./Images/holiday_club_logo.png"></div> 
            </td>
        </tr>
    </table>
</body>
</html>

I have 2 panels( left and right ) inside this view and each partial view is loading i the div "RenderHere" whenevr i click the corrresponding buttons in the rhs.

Supppose i have a button"Branch" and it lists all the branch records from db. this contains a link "Edit" and it opens a dialog box to edit the details.The editing is done properly but after saving again the partial view is loading as the whole page  not
in the RHS part of the main page.

My controller function is as follows and i am rendering partial views each time throught his ActionResult.

  public ActionResult Branch()
        {
            model= new TrackerModel();
             // List<BranchModel> filterdBranchData = null; 
              try
              {
                  model.branchData = this.ppiService.GetBranchData();
                 // filterdBranchData = model.branchData.Where(item => item.IsDisabled.Equals(false)).ToList();
               
              }
              catch (Exception ex)
              {
                  logger.Error("error occured", ex);
              }
              return View(model.branchData);
        }

But after saving the edited record, its  showing as the full page not in right hand side panel of the main page.

Pls  help me

Vidya

You need to use Ajax call for this to load a part of the page

can u please give me an example

First, How r u calling action Branch()?.

What are doing in button clicks?

Hi Vidya,

For this issue, I suggest that you could use AJAX form directly to avoid refresh the whole page.

# Html.BeginForm() vs Ajax.BeginForm()

http://www.codeproject.com/Articles/429164/Html-BeginForm-vs-Ajax-BeginForm-in-MVC

You also could use jQuery AJAX to achieve that.

# jQuery.ajax()

http://api.jquery.com/jquery.ajax/

Best Regards

Starain

[RESOLVED]How to create dynamic controls in MVC4

I need text box, drop down, calendar, Panel when drop down data is selected panel should open that contains controls text box, file upload index event should fire

If you want to add dynamic controls at run time, try partial view. Create a partial view with your needs(textbox, drop down, calender etc..) when you select a drop down value , using jquery ajax call that partial and bind it in the place you need to create
dynamic control.. 

[RESOLVED]Html5 video not playing.

Hi

I am trying to use html5 video in a mvc4 web-application.

For some reason, I only get a Black Square with a controlpanel underneith.

This is my view.

@model Telekoret.Models.Video

@{
    Layout = null;
}


<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Video</title>
</head>
<body>
    <div>
        <video controls="controls" autoplay="autoplay" preload="auto">
            <source src="@Url.Content(@Model.WebM)" type="video/webm" />
            <source src="@Url.Content(@Model.Mp4)" type="video/mp4"/>
        </video>
    </div>

</body>

</html>

and this is my model.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

namespace Telekoret.Models
{
    public class Video
    {
        public string FileName { get; set; }
        public string Mp4
        {
            get
            {
                return Path.Combine("~\data\video\", Path.GetFileNameWithoutExtension(FileName) + ".mp4");
            }
        }
        public string WebM
        {
            get
            {
                return Path.Combine("~\data\video\", Path.GetFileNameWithoutExtension(FileName) + ".webm");
            }
        }
    }
}

I have allready tried using a .htaccess file and to enable hardware accelerated video with no luck.

I have only been able to test in Chrome, since IIs Express 8 is to slow for IE.

Getting video to play in a cross-platform environment can often be tricky, as specific browsers only support certain file types (and you need to use plug-ins to supplement and fill the gaps). As a result you may have to convert your particular video
into multiple different formats so that when requested, the browser can choose the appropriate option for it to play.

Consider Video For Everyone

You may want to consider checking out Video For Everyone which explains setting up video so that it can be used in nearly every environment and browser (using HTML5 and a
Flash-fallback
). There is actually a generator available for this sample plugin available here which will generate the appropriate code that can be used across multiple browsers.

You can read more about this topic in this Microsoft article on Making your HTML5 Video play on Mobile Devices. If you are looking for some additional resources or alternatives (if the above
doesn’t suit your needs or you want to see what else is out there
) check out the list below :

Specific Issues

You mentioned that you are using Chrome, which should support both the .webm and .mp4 formats so that shouldn’t be an issue. However, you might want to try using the Developer Tools (F12) to check the console and ensure that your path is being rendered properly
and that there are not any errors loading these files. If this is the case, you might look at using Server.MapPath() when generating your paths.

You also have an extra ‘@’ within your code that you can take out, which could possibly cause an issue with your pathing :

<video controls="controls" autoplay="autoplay" preload="auto">
            <source src="@Url.Content(Model.WebM)" type="video/webm" />
            <source src="@Url.Content(Model.Mp4)" type="video/mp4"/>
        </video>

or you might be able to just try using the path directly :

<video controls="controls" autoplay="autoplay" preload="auto">
            <source src="@Model.WebM" type="video/webm" />
            <source src="@Model.Mp4" type="video/mp4"/>
</video>

Hi,

The path is likely wrong. The first step is to use "view source" and the network tab in the browser dev tools to check for 404 not found errors.

It seems you are rendering directly @"~datavideoyourfile.mp4" to the client side. ~is a server side notation that needs to be resolved first (implicitely in some cases, explicitely if not done for you)… See:

http://stackoverflow.com/questions/2418050/should-i-use-url-content-or-resolveurl-in-my-mvc-views

Hi

I have checked the view source and both the .mp4 and the .webm file gets a http 200, so the path must be correct.

Assuming that your paths are correct (as you mentioned), your code should be working as long as the <video> element is supported and the appropriate file types are also supported by your browser.

You can see an example here that is working.

Hi Rion

Now, I have tried using video.js and this time it at least shows the first frame. But the controlpanel is gone and the video is still not playing.

I get the following error in line 7124 in video.dev.js : Uncaught TypeError: Cannot read property ‘sources’ of undefined.

This is my updated view:

@model Telekoret.Models.Video

@{
    Layout = null;
}


<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Video</title>
    <link href="~/Content/video-js.css" rel="stylesheet" />
    <script src="~/Scripts/video.js"></script>
    <script src="~/Scripts/video.dev.js"></script>
    <script>
        videojs.options.flash.swf = "~/Content/video-js.swf"
    </script>
</head>
<body>
    <div>
        <video controls autoplay preload="auto" id="videoplayer" class="video-js vjs-default-skin" data-setup='{}'>
            <source src="@Url.Content(Model.WebM)" type="video/webm" />
            <source src="@Url.Content(Model.Mp4)" type="video/mp4"/>
            <p class="vjs-no-js">For at se denne video skal du slå Javascript til i din browser og sikre dig at browseren kan afspille video i enten .mp4 eller .webm formatet. </p>
        </video>
    </div>

</body>

</html>

Try only using one of the video.js files, you probably can remove the video.dev.js one as it is likely intended for development purposes :

@model Telekoret.Models.Video
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Video</title>
    <link href="~/Content/video-js.css" rel="stylesheet" />
    <script src="~/Scripts/video.js"></script>
    <script>
        videojs.options.flash.swf = '@Url.Content("~/Content/video-js.swf")';
    </script>
</head>
<body>
    <div>
        <video controls autoplay preload="auto" id="videoplayer" class="video-js vjs-default-skin" data-setup='{}'>
            <source src="@Url.Content(Model.WebM)" type="video/webm" />
            <source src="@Url.Content(Model.Mp4)" type="video/mp4"/>
            <p class="vjs-no-js">For at se denne video skal du slå Javascript til i din browser og sikre dig at browseren kan afspille video i enten .mp4 eller .webm formatet. </p>
        </video>
    </div>
</body>
</html>

Oups sorry. I missed you already used Url.Content…

Which browser? You are 100% sure this is an HTML standard document. Have you tried with only one of the format or to directly download the video and play it locally to see what happens?

Hi Rion

If I remove the link to video.dev.js I get another error:

VIDEOJS: Error: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) The video could not be loaded, either because the server or Network failed or because the format is not supported.

I get the same error using both .mp4 and .webm one at the time.

If I open the .mp4 file directly in Chrome, it only plays the sound, so .mp4 is not supported by Chrome, but if I do the same thing with the .webm file it shows the video correctly, som .webm is supported by Chrome.

Hi PatriceSc

It’s a MVC view, which is being translated to a html5 website in runtime.

For the rest of your questions, check my answert to Rion.

I changed your model to use http://techslides.com/demos/sample-videos/small.webm and it works fine here. What if you try with this particular url?

The generated markup is :

     <video controls="controls" autoplay="autoplay" preload="auto">
            <source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm" />
            <source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4" />
     </video>

Though using a player is good idea, you may run into the same unknown issue so I started from your original post. You really didn’t saw anything special when using "view source"? What if you try with this same external file? Do you see the same HTML marlup?
Does it play the video?

If I use your links, the video Works, also without the video.js player.

Could there be a limit to the size of the video-files, and if so, can I change it in the config file?

As far as I know there is an upload limit but I don’t remember about a download limit. Also my understanding is that you are able to download your video from the *same * (?)web site and play it locally? And you tried the http dev tools in the browser and
it reports 200 OK?

The only thing I could think off for now would be the mime type not being registered for webm but then you would have a 404 Not found….

Ah, what if you get this file and place it on your server? Does it work? If yes it dépends on the file (size and/or format). If not, it is some kind of server configuration issue.

I’m running the webapplication on localhost and the videofiles is located on my pc.

Do I need to configure my iis? I’m using ISS Express 8.

Has anyone come up with a solution?

The problem is that for now we don’t know exactly what happens.

So if you download the video files I mentioned earlier for testing on your own machine, does it work ? It would allow to find out if it is a file problem or a site problem.

The strange thing is that my understanding is that you do have an HTTP 200 (and have you checked if the content is correct or if maybe the content is actually some HTML page ?). You are 100% sure the video Stream is downloaded correctly? You see nothing
special on the IIS side in the IIS log or whatever…

My first thought was a mime type issue (file types with no registered mime types are not served but then you should have a 404 error for example). I’ll try to give a quick try to what happens if I get the test video files I talked earlier on my machine and
give this a try.

So for now my understanding is that all happens as if there is no problem at all (the url is not wrong, the http request status is 200, the content is correct (I believe you can "save as" the content in most browser tool and then see if it seems the same
than the file you uploaded).

It’s much harder to diagnose an issue when we can’t even spot some error message or bad behavior that shouldn’t happen.

Really can’t see what happens on your side. I gave this a try with

<video controls="controls" autoplay="autoplay" preload="auto">
        <source src="/small.webm" type="video/webm" />
</video>

I downloaded the sample file I used earlier to the root of a test MVC site and running this in Chrome from VS (and it just works.. Could it be some kind of firewall/proxy/antivrus/whatever issue? Or does it work on your side?

I gave this a try and it works. I downloaded the webm sample file I used earlier, placed it at the root of an MVC test site and ran this test site from VS using Chrome :

<video controls="controls" autoplay="autoplay" preload="auto">
        <source src="/small.webm" type="video/webm" />
</video>

Hopefully it should work on your side? If yes, move from there one step at a time to see what starts to make this fail. If it still doesn’t work some kind of external condition such as an antivirus software or whatever? Good luck, seems a tough one…

Hi PatriceSc

It cannot be a download problem, since the file is allready on my computer as a part of the project.

My Iss logs does not show any errors.

However, in the developer tools->Network, the line with the loading of the videofiles returns status=200 but it is also colored red, and when i click them and try to see the responsedata, it says "Failed to load responsedata".

If it couldn’t load the responsedata, why is the status=200?

I made a change in the model and view, so the view now gets the full path to the file. The result is the following html:

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Video</title>
    
</head>
<body>
    <div>
        <video controls autoplay preload="auto" id="videoplayer">
            
            <source src="c:userselsedocumentsvisual studio 2013ProjectsTelekoretTelekoretdatavideoStilleHjerte.webm" type="video/webm" />
            <source src="c:userselsedocumentsvisual studio 2013ProjectsTelekoretTelekoretdatavideoStilleHjerte.mp4" type="video/mp4" />

            <p>For at se denne video skal du slå Javascript til i din browser og sikre dig at browseren kan afspille video i enten .mp4 eller .webm formatet. </p>
        </video>
    </div>
   

<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
    {"appName":"Chrome","requestId":"8e3a9ae1f8d148c4b6483b9abfa9eeaa"}
</script>
<script type="text/javascript" src="http://localhost:62270/8abd778028a34c99b7c91522eec816af/browserLink" async="async"></script>
<!-- End Browser Link -->

</body>

</html>

The strange thing is that, if I try to debug it in Visual Studio using Chrome, it does not show the video, but if I copy the source from Chrome to notepad, save it as a .html file and opens that one in chrome, it Works.

Ahhhh !! Don’t test with local file names. Do use an http link instead.

I’m not sure it applies to localhost but as a safety measure a web site doesn’t have access to local content by default so if you are showing this page through localhost I would quite expect this to fail (and I’m sure it would fail for a real web site anyway).
It would explain also that if you copy the source to a local file then it works (as now this is a *local* HTML page that uses a *local* resource so it is allowed).

As it was one of the first issue, I thought it was fixed. Could it be just that? In a way it would be best as it would explain it all…

So try again with something such as src="/data/video/StilleHjerte.webm"  (I assume data is right Under your web application root). Does it work?

Hi PatriceSc

Using src="/data/video/StilleHjerte.webm"  did not help, and it still fails to load response data.

Is it posible to see, if a safety measure is the problem?

Besides, I dont follow you: You say that a local html page are allowed to use local resources, but isn’t localhost regarded as a local html page?

So and when using
https://developer.chrome.com/devtools/docs/network
 what do you see for the http request? My understanding is that you saw 200 OK rather than for example 404 Not found…

For example I see :

If you have 200 OK (that is all is supposed to be fine) I really don’t get what happens on your side while it works just fine on mine. You could also try to test with the SAME test file than the one I used to elimate all différences.

That is correct.

The two video sources shows statuscode 200.

However, I have now noticed, that there is a browserlink, which gives me a http 404.0 Not Found.

Could that be causing the problem?

Don’t know but worth a try. See http://www.asp.net/visual-studio/overview/2013/using-browser-link#disabling to disable this…

Else it seems really some kind of configuration related issue (you tried with the same file than me, if you can try an another PC possiblty with a different configuration home/work/friend etc…). Good luck.

Disabling browserlink did the trick.Laughing

The video is running just fine.

Thanks for your help.

[RESOLVED]button inside panel control

hi,

I have a panel control in a page that uses a master page.  There are some text boxes and labels in the panel that are position properly, but I’m having problems with the button.

The panel is inside a div that has the property position:relative and the panel has property position:absolute.  The css used for the button seems to be ignored.  There must be something I don’t understand.  Why wouldn’t I be able to style the button like
a text box inside a panel?  Thank you for any tips.

try to use debugger tool of browser and see where is the prblm . hope this helpsCool

Hi maggiemays,

Thanks for your post.

Only with your simple description, we hardly figure out why the button cannot use css style.

Please share a simple demo with us and let us reproduce your issue. Thanks.

Best Regards!