|
Hi everybody,
I have problem with view menu in ASP.NET MVC:
My Model:
Category {Id, Name},
Subpplier {Id, Name},
Product {Id, Name, CategoryId, SupplyId, ...}
So I want to show my menu to 2 levels:
Level 1: Show Category list
Level 2: Show Supplier list in each Category from Products.
But i just can show Level 1 by Model = db.Categories. I can't show level 2 and how to get Supplier list from controller to view?
Please help me!
Thanks!
|
|
|
|
|
in your category model do you have navigation property to get list of suppliers?
If yes then For Level 2- you can do same thing which you did for level 1
Thanks
|
|
|
|
|
so true in your category model do you have navigation property to get list of suppliers?
If yes then For Level 2- you can do same thing which you did for level 1, and then deploy for your code in mvc and database,
or module in css menu for multiple menu,
thanks
sign
Lowongan Kerja
modified 23-Oct-15 21:22pm.
|
|
|
|
|
I want to check whether entered email id (eg. xyz@ymail.com, abc@rediffmail.com etc) is already exists or not. I dont want to use any third party payable tool or dll in software. Please help me out.
|
|
|
|
|
Which language you want to code it?
|
|
|
|
|
|
|
Richard Deeming wrote: The only way to verify whether an email address actually exists is to send a message to it.
I would say, the only way to verify whether an email address actually exists is to receive a message from it...And also that is just for the moment...
Skipper: We'll fix it.
Alex: Fix it? How you gonna fix this?
Skipper: Grit, spit and a whole lotta duct tape.
|
|
|
|
|
Receiving a message from an email address doesn't necessarily mean the address exists.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
That information is not stored in a single location; they are created on a mailserver, and those do not provide a public list.
That is why the send-link-pattern was mentioned; it is the only way to verify whether an address is actually in use.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Checking email addresses for validity is a tricky process. EmailValidator.Net has made this process incredibly simple and powerful.
The only correct way to verify an email address exists is to send a mailbox an email and see if you receive a bounce back email or NDR (Non-Deliverable Receipt). EmailValidator.Net validate email addresses WITHOUT sending an actual email.ss
C# code sample :
protected void LinkButton1_Click(object sender, System.EventArgs e) {
// We create our Mail Validator Object
Codicode.Emailvalidator Ev = new Codicode.Emailvalidator();
// Sender email (for smtp identification)
Ev.Mail_From = "admin@monoprog.com";
// Sender email (for smtp identification)
bool Valid_Email = Ev.Check_Mailbox(Textbox1.Text);
}
protected void LinkButton2_Click(object sender, System.EventArgs e) {
// We create our Mail Validator Object
Codicode.Emailvalidator Ev = new Codicode.Emailvalidator();
// Sender email (for smtp identification)
string[] Mx_Records = Ev.FindMXRecords(Textbox1.Text);
}
thanks
sign
Lowongan Kerja S1
modified 23-Oct-15 22:58pm.
|
|
|
|
|
I understand your reluctance to use third-party tools, because I encountered a very similar problem (with very similar requirements) working on a project for one of my customers.
Email verification is a complex process, and it requires several validation levels:
1. The email address itself must have the correct syntax, so a regular expression check is needed.
2. The email address must reference a valid domain name, so a DNS query is needed.
3. The email address must reference a domain name that accepts mail server connections, so an SMTP connection is needed.
4. The email address must reference a valid inbox on the receiving mail server, so a send (or send attempt) is needed.
You don't have to use the components from this particular developer, but you might his descriptions of the above levels sufficiently detailed to implement your own solution using your own code. Refer to the section titled "Understanding Validation Levels" on this page:
http://www.afterlogic.com/mailbee-net/docs/getting_started_with_address_validator.html[^]
Speaking from my own experience, it is certainly possible to write the code to implement all four validation levels, but it turned out to be too expensive and too time-consuming for my customer, and so I was able to convince them to license software components from that developer.
|
|
|
|
|
Can we forward a port on mobile through which my pc is connected?
|
|
|
|
|
Can you please describe it briefly. I mean your exact requirement.
|
|
|
|
|
actually i have requirement to run my asp.net application which include database server connected to a router and host machine connected to different newtwork.(i.e through mobile).just wanna test how does it work in diff network in wan..in this way i have to do port forearding in my mobile ..how can i set up port forwarding in mob
|
|
|
|
|
Member 11919722 wrote: port forwarding in mob
How do you mean? Incoming to your handset or using it as a wifi hotspot?
|
|
|
|
|
incoming to my handsset...once i type a publiv ip address then...it gets connected to my handset in which my hoast mashine ip address is confugred..as it happens in router same way how can it b possible in habdset
|
|
|
|
|
I don't think it's possible. Mobile operators control NAT, users are clumped onto shared public IPs. You wont be able to forward it as you don't control the gateway server. 3G/4G isn't designed for these kinds of applications.
|
|
|
|
|
thanks for your valuable response....by the way i have one more question .i.e can we give a meaningful name to public ip address...as example m accessing my application using public ip address/directory/page.aspx ...which is working fine over wan ..but i have requirement of giving my public ip address a meaningful name...like ...tata/directory/page.aspx...where tata is nothing but leads to my public ip address..please help me out with your solution.
Thanks
|
|
|
|
|
i got the solution for above question of giving meaning full name to ip address ..likewise hoe can we give both ip address and port number should be binded to one name ..since now m able to access my app with meaningful name of ip address but have to mention port no ...i dont want port no to be mentioned without mentioning it how can we do ...all in all binding both ip address and port no to a single meaningful name
|
|
|
|
|
Hi all,
I am very new to angularjs. For learning purposes I wrote a sample application that will render a partial page inside main page. For this I have used angularjs dynamic routing inside asp.net MVC project. Also I have hosted the website I created because I have used $location.
The problem I am facing is that When I try to click on the link "Client Information", i get the following error:
Quote: Error: [$compile:tpload] http://errors.angularjs.org/1.3.0/$compile/tpload?p0=ClientInfo as seen in the F12-> Console
My code is as below:
index.cshtml
@{
ViewBag.Title = "Home Page";
}
<link href="../../Content/dealnavigation.css" rel="stylesheet" type="text/css" />
@section scripts{
<script src="~/Scripts/angular.min.js" type="text/javascript"></script>
<script src="~/Scripts/angular-route.min.js" type="text/javascript"></script>
<script src="~/Scripts/angular/script.js" type="text/javascript"></script>
}
@section featured {
<section class="featured">
<div class="content-wrapper">
<hgroup class="title">
<h1>@ViewBag.Title.</h1>
<h2>@ViewBag.Message</h2>
</hgroup>
</div>
</section>
}
<div ng-app="deals" ng-controller="newdealController">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<ul class="nav nav-wizard margin-bottom-20 hidden-print">
<li >
<a ng-click="GotoClientInfo()" href="javascript:void(0);">Client Information </a>
</li>
<li >
<a ng-click="GotoFacilityInfo()" href="javascript:void(0);">Facility Details </a>
</li>
</ul>
</div>
<div ng-view>
</div>
</div>
script.js is the file where I have defined angular related code.
script.js
var $routeProviderReference;
angular.module('deals', ['ngRoute'])
.config(['$routeProvider', function ($routeProvider) {
debugger;
$routeProviderReference = $routeProvider;
$routeProviderReference.when('/Step1', {
templateUrl: 'ClientInfo',
controller: 'newdealController'
});
$routeProviderReference.when('/Step2', {
templateUrl: 'FacilityDetails',
controller: 'newdealController'
});
} ])
.controller('newdealController', function ($scope, $location, $route) {
$scope.GotoClientInfo = function () {
debugger;
$location.path('Step1');
$route.reload();
console.log($route);
};
});
HomeController.cs
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
return View();
}
public ActionResult ClientInfo()
{
ViewBag.Message = "Client Info.";
return PartialView();
}
BR,
Arjun
modified 21-Oct-15 9:56am.
|
|
|
|
|
Hi I have a table with more than 30 columns and I have to perform Insert Operation.
Is there any way simple.????
|
|
|
|
|
No. You'll need to pass in all the parameters. You could of course load an input file, but I still say that specifying each parameter is easier. It's a pain, but the only way to get data into those fields.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks If you find any way let me know.. right now used excel to get rid of typing..
|
|
|
|
|
Greetings gurus,
This problem has bugged me down all day.
The subs below allow our users the ability to save a file to the server and filename and path to the database.
This works great except that management doesn't want users forced to upload a file if they don't want to.
In other words, uploading of a file should be optional, not required.
So far, I have tried several different things to remove only the part that challenges users to upload a file before record is saved.
I have also tried googling for easier solutions but have found none yet.
Any assistance is greatly appreciated.
Protected Sub Btn_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim btn As LinkButton = DirectCast(sender, LinkButton)
Dim savecontinue As String = btn.CommandArgument
Dim correctExtension As Boolean = False
'Dim blSucces As Boolean = False
Dim FilePath As String = ConfigurationManager.AppSettings("FilePath").ToString()
If FileUploadToServer.HasFile Then
Dim fileName As String = FileUploadToServer.PostedFile.FileName
Dim fileSize As Integer = FileUploadToServer.PostedFile.ContentLength
Dim fileExtension As String = Path.GetExtension(fileName).ToLower()
Dim extensionsAllowed As String() = {".pdf"}
If extensionsAllowed.Contains(fileExtension) Then
correctExtension = True
End If
If correctExtension Then
If fileExtension = ".pdf" Then
Try
FileUploadToServer.PostedFile.SaveAs(filePath)
SaveFileInfo(fileName, fileSize, FilePath)
lblResult.Text = "File successfully uploaded and file path saved in database"
lblResult.ForeColor = Drawing.Color.Red
Catch ex As Exception
lblResult.Text = "Unable to upload file"
lblResult.ForeColor = Drawing.Color.Red
End Try
End If
''Check if file already exists. If so, delete it and replace with new one
If File.Exists(Server.MapPath(FilePath) & fileName) Then
File.Delete(Server.MapPath(FilePath) & fileName)
End If
' Get size of uploaded file, here restricting size of file
fileSize = FileUploadToServer.PostedFile.ContentLength
If FileSize <= 26214400 Then
'1048576 byte = 1MB
'Get file name of selected file
fileName = Path.GetFileName(FileUploadToServer.FileName)
'Save selected file into specified location
FileUploadToServer.SaveAs(Server.MapPath(FilePath) & fileName)
lblResult.Text = "File uploaded successfully!"
lblResult.ForeColor = Drawing.Color.Red
'blSucces = True
Else
lblResult.Text = "Attachment file size should not be greater then 250 MB"
lblResult.ForeColor = Drawing.Color.Red
End If
Else
lblResult.Text = "File extension " + fileExtension + " is not allowed"
lblResult.ForeColor = Drawing.Color.Red
End If
End If
End Sub
Private Sub SaveFileInfo(ByVal strfilename As String, ByVal size As Integer, ByVal strPath As String)
Using Sqlcon As New SqlConnection(connStr)
Using cmd As New SqlCommand()
Sqlcon.Open()
cmd.Connection = Sqlcon
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "InsertOrUpdate"
cmd.Parameters.Add(New SqlParameter("@EmpID", Session("EmpNum")))
cmd.Parameters.Add(New SqlParameter("@ckRequestReview", ""))
cmd.Parameters.Add(New SqlParameter("@RequestedTitle", txtTitleChange.Text))
cmd.Parameters.Add(New SqlParameter("@TitleChangeComments", txtTitleComments.Text))
cmd.Parameters.Add(New SqlParameter("@RequestedPay", txtPayGradeChange.Text))
cmd.Parameters.Add(New SqlParameter("@PayChangeComments", txtPayComments.Text))
cmd.Parameters.Add(New SqlParameter("@RequestedClass", txtClassSpecChange.Text))
cmd.Parameters.Add(New SqlParameter("@ClassChangeComments", txtClassComments.Text))
cmd.Parameters.Add(New SqlParameter("@EmpSignature", txtsign.Text))
cmd.Parameters.Add(New SqlParameter("@finishedOrUnfinished", "Finished"))
cmd.Parameters.Add(New SqlParameter("@ManagerID", divManager.SelectedValue))
cmd.Parameters.Add(New SqlParameter("@DeptID", Session("DeptID")))
cmd.Parameters.Add(New SqlParameter("@DirectorID", Session("DirectorNum")))
cmd.Parameters.Add(New SqlParameter("@apFileName", SqlDbType.VarChar, 100))
cmd.Parameters.Add(New SqlParameter("@apFilepath", SqlDbType.VarChar, 100))
cmd.Parameters.Add(New SqlParameter("@FileSize", SqlDbType.Int))
cmd.Parameters("@apFileName").Value = strfilename
cmd.Parameters("@apFilepath").Value = strPath
cmd.Parameters("@FileSize").Value = size
cmd.ExecuteNonQuery()
Dim rows As Integer = cmd.ExecuteNonQuery()
If rows = 1 Then
lblResult.Text = "Record Successfully Saved. Please log out and close your browser"
lblResult.ForeColor = System.Drawing.Color.Red
End If
End Using
End Using
End Sub
|
|
|
|