C#,vb.net,MVC,Jquery,javascript,jscript,vbscript,html,vb,sharepoint,COM,WPF,WCF,Wwf,Asp,Asp.net,questions & answers,

Latest in Sports

Showing posts with label MVC. Show all posts
Showing posts with label MVC. Show all posts

Friday, January 24, 2014


I have a clarification on CodedUI Testing process.

1. What is the main use of this CodedUI Testing

2. I am using MVC 4 in Visual studio 2012

3. I have created Test builder and when i am recording the steps and generating code, it shows error like your visual studio in debug mode.

4. How can i apply Assertion.

5. How can i check with browser compatibility of UI Controls

6. how can i check with different positive and negative scenarios

 Please guide me , because i am facing difficulties over this
I am developing MVC 4 Razor Application.

I  Placed  a “ Action Link “ Download Button which downloads file from HTTPS Sharepoint Server.

Error : Am getting 403 Forbidden Error in Web Request


Code Snippet :


string url = "https://xyz.com/files/sample.docx"; --à SharePoint Server File URL

            WebRequest request = WebRequest.Create(new Uri(url, UriKind.Absolute));

            request.Credentials = new NetworkCredential("XYZ", "XYZ");

            WebResponse response = request.GetResponse();

            Stream fs = response.GetResponseStream() as Stream;

            byte[] buffer = new byte[16 * 1024];

            using (MemoryStream ms = new MemoryStream()) {

                fs.CopyTo(ms);

              buffer=  ms.ToArray();

            }

            return File(buffer, "application/vnd.openxmlformats-officedocument.wordprocessingml.document", fileName);


I got 403 Forbidden Exception in Highlighted Area.

Friday, July 13, 2012

This is regarding the issue in export functionality with Asynchronous call in MVC3 ASP.NET.

1) Below is the export method will be invoked during our asynchronous call.
<HttpPost()>

Function ExportHomeAccountGroup(ByVal model As Home, ByVal formdata As FormCollection) As ActionResult

Dim array As Byte()

model = New Home

array = _sourceFacade.ExportAccountGroupList(model.Input)

Dim csvFile As FileContentResult = File(array, _fileType, _fileNameAccountGrp)

Return csvFile

End Function


2) Below is the script which will invoke the export method:

$("#btnExport").click(function () {

$.ajax({

url: '/Home/ExportHomeAccountGroup',

type: 'post',

data: dataForm,

cache: false,

datatype: 'html',

success: function (updatedHtml) {

updateView("DivExport", updatedHtml);

}


});


});



We are unable to get the “Open or Save” after the csv file is returned. Is this because of the full view is not rendered while the CSV file is returned?.

Note: We are able to achieve this functionality thru Synchronous call. However we have to perform this thru Asynchronous call as per the requirement.

Please help us resolving this issue


Thanks -Subash

Sunday, June 17, 2012

We are using MVC telerik grid control in our application. In that we are facing one issue in the sorting of the grid columns.
To avoid the post back  we are using the grid ajax binding and grid operation mode as client,but we are getting the JavaScript errors like Error 404,Error 500 while loading the page and sometimes  while retrieving the data for the page. So we want to know if is there any client event available for the telerik grid in which we can call the custom Sorting function.
Any help would be highly appreciated

Wednesday, May 30, 2012

We have developed an application using VS2010 in MVC pattern. During the development we completely used IE8 to execute this application which worked brightly without any issue. But the same application gives error when we execute this by IE7. The clear error message which we are getting from IE7 is given below for your reference

When we click OK button from error message, page is turning to “Page can’t display error”.  We know by going through JS files we could fix this but the challenge is we have used many JS files across application. And debugging each JS file to identify error is really pathatic. If any one of your project faced such issue and resolved it, please help us to fix this issue.
 
Thanks in Advance

Tuesday, May 22, 2012

We are facing the problem while implementing the Client Side Sorting in the MVC Telerik grid.
Steps Followed
    * Done Data Binding using Ajax  in the partial view and set the operation mode to Client as below:-
                                            .DataBinding(Function(obj) obj.Ajax().OperationMode(GridOperationMode.Client)) _
    * Enabled the Sortable Property of the telerik grid.
                                            .Sortable() _
    * Loaded the Partial view in the Parent page to open the Partial view as below
                                             @Html.Partial("~/Views/EventNumber/EventSearch.vbhtml", eventNumberModel)
    * when we try to load the parent screen, it is throwing Error 404
 
     * And when we removed the Databinding from the telerik grid, it is not throwing this error.
 
So is this the problem with databinding or something else. and is there any other way through which we can perform client side sorting in MVC telerik grid without using databinding.
 
SOLUTION 1:
 
@Html.Partial("~/Views/EventNumber/EventSearch.vbhtml", eventNumberModel)
 
Remove “.vbhtml” and check again.