Subscribe: Web Forms
http://forums.asp.net/rss.aspx?ForumID=18
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
col  columns  data  gridview  model  mvc  net  page  runat server  runat  select  server  string  text  textbox  view  web 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Web Forms

All Forums



All Forums



Last Build Date: Sun, 04 Dec 2016 00:53:28 -0800

 



How do I specify the flow direction of text?

2016-12-02T22:29:12.023-08:00

I have created a website where trusted users are able to translate the text on the web pages.  But, I am having trouble with changing between “Left to Right” and “Right to Left” of translated text on each web page for a specific language.  I understand that there is a FlowDirection="LeftToRight" command.  But, I do not understand how to specify the direction in the code segment of each web page, depending upon what is specified in the database.  Can anyone help me please?

 

Maurice




Need suggestion for creating web api wrapper project on top of MVC application

2016-12-04T06:38:24.53-08:00

Hi ,

    I have  developed application in MVC 5.0 by utilizing the default features of Authorization and Authentication .Currently we are looking for hybrid mobile app by using angular js for same project. So I want to create Web API layer on top of this MVC application.

   Can you please guide me what is the best way to do this and How can I utilize the Default security features of MVC in web API calls without any modifications of my existing project?  Please post any reference links on the same it will helpful.

Thanks ,

Venkat.

 




Can not import excel data after deploying ASP.NET website

2016-11-30T11:01:56.01-08:00

Hi I am facing wired problem but so far common in ASP.NET web page. When I run through localhost then it successfuly import data from excel file. But after deploying in a windows server 2012 in IIS then it does not work. All other data come nicely such as all query and data access is fine. But the import does not work.  I have google this problem but their solution is to install Microsoft Access Database Engine 2010 Redistributable. I have installed this and restart but not working. I can not find the problem. Please help me to solve this problem.  I have installed MS Office 2013 andWIndows server 2012 iin my machine. Below I have past my codes. Thanks in advance protected void btnImport_Click(object sender, EventArgs e) { try { if (FileUpload1.HasFile) { string FileName = Path.GetFileName(FileUpload1.PostedFile.FileName); string Extension = Path.GetExtension(FileUpload1.PostedFile.FileName); string FolderPath = ConfigurationManager.AppSettings["FolderPath"]; string FilePath = Server.MapPath(FolderPath + FileName); FileUpload1.SaveAs(FilePath); Import_To_Grid(FilePath, Extension); } } catch (Exception ex) { lblError.Text = ("Error:" + "Select appropritae criteria"); } finally { Label1.Text = "Database import Successfully"; Create_DB(); UpdateTime(); Fn.CloseConn(); } } private void Import_To_Grid(string FilePath, string Extension) { int totalRow = 0, index = 0; string conStr = "", Col1, Col2, Col3, Col4, Col5; SqlCommand cmdSqlUpdate; switch (Extension) { case ".xls": //Excel 97-03 conStr = ConfigurationManager.ConnectionStrings["Excel03ConString"] .ConnectionString; break; case ".xlsx": //Excel 07 conStr = ConfigurationManager.ConnectionStrings["Excel07ConString"] .ConnectionString; break; } conStr = String.Format(conStr, FilePath, "Yes"); OleDbConnection connExcel = new OleDbConnection(conStr); OleDbCommand cmdExcel = new OleDbCommand(); OleDbDataAdapter oda = new OleDbDataAdapter(); DataTable dt = new DataTable(); cmdExcel.Connection = connExcel; //Get the name of First Sheet connExcel.Open(); DataTable dtExcelSchema; dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); string SheetName = dtExcelSchema.Rows[0]["TABLE_NAME"].ToString(); connExcel.Close(); //Read Data from First Sheet connExcel.Open(); cmdExcel.CommandText = "SELECT * From [" + SheetName + "]"; oda.SelectCommand = cmdExcel; oda.Fill(dt); totalRow = dt.Rows.Count; Col1 = dt.Columns[1].ColumnName; Col2 = dt.Columns[2].ColumnName; Col3 = dt.Columns[3].ColumnName; Col4 = dt.Columns[4].ColumnName; Col5 = dt.Columns[5].ColumnName; Col6 = dt.Columns[6].ColumnName; Fn.CreateConn(); foreach (DataRow row in dt.Rows) { index = dt.Rows.IndexOf(row); if (index >= 2) { cmdSqlUpdate = new SqlCommand(@"INSERT INTO TrackReport(EmpID, Name, MobileNumber, Department, Address, Time) VALUES('" + row[Col1].ToString() + "','" + row[Col2].ToString() + "'," + row[Col3].ToString() + ",'" + row[Col4].ToString() + "','" + row[Col5].ToString().Replace("'", "") + "','" + row[Col6].ToString() +[...]



asp roles not working

2016-12-04T05:40:07.097-08:00

Hello,

I'm using vs2010 I'm having an issue, I have created an event for the login clicked on the asp.net login.  I'm trying to use if (user.isinrole("Sales")) Response.Redirect to a specific folder with a default page that I've created.  Although even trying to redirect to the asp.net about page doesn't work either.  If I type the page address in manually to the URL it works, however if I deny another role member in the web.config file it doesn't seem to deny them either.  What could I be doing wrong?

Thanks

George




Three tier architecture in 2 tables (Veg and Non-Veg Menu)

2016-12-03T03:17:05.18-08:00

Good Morning Everyone!

I need to bind 2 gridviews (from 2 individual tables), placing them in a single div, aligning them right and left and doing it with bel, bal and dal. How to achieve this task? I mean to say that you need to create 2 functions in bel,declaring their properties. VegMenu table has 4 fields, id, name, half size, full size. Non Veg Menu has five fields, id, name,quarter, half and full size. I am a very novice developer, so asking too many questions everyday... Thank you alll so much so much for the kind help :). Looking for the kind help...

There are two tables veg and non veg menu. I need to get the data and display it in  gridview  and do this with three tier architecture... Looking for early response. Thanks a lot.... 




change default error message

2016-12-03T09:47:24.703-08:00

Hi, I'm using MVC 5 Identity for user register.

when I enter in the password textbox a password like : 123456 I got below error

Passwords must have at least one non letter or digit character. Passwords must have at least one lowercase ('a'-'z'). Passwords must have at least one uppercase ('A'-'Z')

how can i change this message to whatever I want?




Asp.net core Release version

2016-12-01T17:34:53.117-08:00

Which is the latest version of ASP.Net core released ?
Also if try to install on Linux it gives preview version of .net core ? Which release version is compatible with Linux ?




html5 video not supported in safari

2016-12-04T01:37:42.737-08:00

Hi guys,

All browser works and not safari.

My Code:

Any ideas ?




ASP.NET core class libraries vs desktop winforms class libraries ?

2016-12-02T13:15:28.807-08:00

Suppose i made a new ASP.NET core MVC app targeting the "full" .net 4.6.1 framework. i then added a few .net 4.6.1 class libraries to the solution for various purposes (service layer ,business layer ,data access layer ,utility .. etc). 

the question : can i grap those .net 4.6.1 class libraries and use them to make desktop winforms app with similar functionality ?

The same question with different wording : does developing for ASP.NET core vs winforms (assuming both targeting 4.6.1) differ only in the presentation layer with no differences in other layers ?




Conversion from type 'DBNull' to type 'String' is not valid (How to fix this code)

2016-12-04T00:14:07.18-08:00

This code reads the data from the data source control,

Dim dv As DataView
dv = CType(SqlDataSource1.Select(DataSourceSelectArguments.Empty), DataView)
For Each dr As DataRow In dv.Table.Rows
       Response.Write(CType(dr("field01"), String))
Next

When there is a blank field, it displays this error:
Conversion from type 'DBNull' to type 'String' is not valid
How can I fix this code
Thank you in advance




ASP.NET MVC View dynamically changes according to dropdownlist selection

2016-12-03T20:38:19.723-08:00

Hi, 

I am new to MVC 5 and I have a scenario that requires me to develop a registration form that changes according to the selected dropdownlist value. For example, if i select Admin from the dropdownlist, the view will display 3 fields for registration such as username, password and email. Subsequently, if i select "Normal User" from the dropdownlist, the view will change to display 5 fields for registration such as username, password, email, age and address. After filling up the fields, I can then press the submit button and save the data to the corresponding table accordingly.

I've tried implementing this by having 3

classes for each user roles. And having Javascript to hide and show the
classes acccoridng to the dropdownlist changes. However, it does not work. Is there any great way to implement this?

Any comments and feedbacks are much appreciated!




URL Creation

2016-11-23T19:42:56.207-08:00

How do you create a url form a cshtml page that will be  filled out and submitted.

The form data will be saved to a database with a column that is a  composite primary key  (Formname + Guid) and a column that will hold a URL is saved which when clicked points to this form with data  outside of mvc.  How can this be done?  




error in web server

2016-12-03T17:07:11.74-08:00

i am facing error when i am submiting data in my website

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.




In what kind of situation people has to create proxy in wcf or asmx web service

2016-11-28T12:26:33.99-08:00

most of the time web service company provide wsdl or endpoint address url as a result client can create proxy but tell me few situation when web service company do not like to provide wsdl or endpoint address url to client to create proxy.

please tell me few scenario where user has to create proxy dynamically? thanks




Hiding Asp.net pages

2016-12-03T23:16:49.863-08:00

Hi everybody in a project, the user will hide or show the asp.net pages according to him.

As an example I have a control panel page here I need to pull the pages in the project (category.aspx etc.) to show or show this page.

How is that possible. Do you have ideas?




How to send an authenticated E-Mail?

2016-12-02T13:10:07.13-08:00

Hello,

I want to send authenticated emails from within my web application to prevent them to be delivered into the recipient's "Junk" folders.

I tried this code:

        private static void send_authenticated(MailMessage msg)
        {
            try
            {
                SmtpClient cli = new SmtpClient(cfg_Server);

                cli.DeliveryMethod = SmtpDeliveryMethod.Network;
                cli.EnableSsl = false;
                cli.UseDefaultCredentials = false;
                cli.Credentials = new NetworkCredential("myUser", ""); 
                cli.Send(msg);
                txt_Status = "OK";
            }
            catch (SmtpException exc)
            {
                txt_Status = exc.Message;
                txt_Status += "\n" + exc.Source + "\n" + exc.StackTrace;
            }
            catch (Exception exc)
            {
                txt_Status = exc.Message;
            }
        }

There is a username "myUser" and an empty password. The username is the name of a group mail address, which has no password.

Well, the email arrives at the recipient. Then, I changed "myUser" to something that doesn't exist, and the mail also arrives.

Because of this behavior, I believe that there is no authentication at all?

What am I doing wrong?

Thanks
Magnus




How ASP.Net MVC support separation of concerns

2016-11-30T13:43:46.833-08:00

in webform aspx page was tightly couple with code behind file. so the person who is working with aspx file he has to write code in code behind.

the same way asp.net mvc provide controller, view and model. but think when model is not created then how a developer will create controller which refer that model class and same model is also refer in view too. in mvc by theory there is no dependency between controller, view and model but practically when some one will start work then they found there is dependency between between controller, view and model because person A can not complete his controller code if model is not prepared and same way person B can not complete view if model is not prepared because we refer model in view too and as well as we use various model property name in view to show suppose employee data.

so anyone can tell me what MS try to say separation of concerns in asp.net MVC ? please explain with easy example and also compare the same with web form .

thanks




Gridview - C# - asp page (with master) - Grid remains on Screen AFTER select

2016-12-03T20:03:55.147-08:00

Hello, I have an issue that I need your help with please. I have a ASP page (C#) with a Gridview pulling data from SQL Server (code below). This one, when I press select ( ), I get the value to the textbox and the gridview disappears. That is what I want. I have two other gridviews on the same page, but on select, they are leaving the gridviews ON the screen - not the entire gridview return, just the selected item (i.e. if search yields 15 results, gridview show 15 results. When I select 1 of the results, gridview remains on screen, but only the one record selected.). I dont want that. What can I do to tell the gridview that after select, go away... <%-- ReSharper disable Asp.Image --%>
<%-- ReSharper restore Asp.Image --%> [...]



webRTC with signalR on browsers live chat

2016-12-03T19:49:59.283-08:00

Is it possible to use signalR on top of webRTC in order that non webRTC supported browsers will get only video data with no sound.

They will not be able to broadcast but only receive video data through signalR websocket and use the html5 canvas to show it.

So basically i need 1 regular webRTC upload streaming that signalR server Splits into 2 kind of streaming broadcasting one regular webRTC and one video data through websocket for use in the html5 canvas to show it.

Dose signalR can give me that solution?




Multiplying two gridview colums to get the third column in a gridview

2016-12-03T15:29:59.697-08:00

Hello, I have been trying to multiply two columns in my gridview to give the total, but I have not been able to have a breakthrough here is my Gridview and what I have Tried