|
I've read about it but I haven't done any hands-on coding with it. It seems interesting to me and I'd like to try it out. I'll give you an update or perhaps make an article about it after trying it out.
|
|
|
|
|
I tried the getting started but all I got was a white page, with the <Router> tag in it, i.e. did not execute / expand to the full page with page content ...
I guess I will try again with 0.4 ...
Despite that, I'd say it looks promising!
I wonder how easy it will be to call a JavaScript API. I know they have interop (read about it). But if said API has zillion of method, like GoogleMap for example, I wonder how tedious it's gonna be...
|
|
|
|
|
Super Lloyd wrote: but all I got was a white page, with the <Router> tag in it, i.e. did not execute / expand to the full page with page content ...
Perhaps it has something to do with the version you used. Have you tried upgrading to the latest? See this short discussion here: https://github.com/aspnet/Blazor/issues/635
|
|
|
|
|
|
You bet! Goodluck with your exploration.
Now I'm excited to get my hands dirty with Blazor too.
|
|
|
|
|
And... it's now working!
Will study JavaScript interop later this week.. which is the feature the I wonder most about..
Everything else looks pretty slick yet obvious (for an MVVM, and VueJS addict that I am)!
Mm... better JS interop seems to be a TOD..
Javascript interop documentation · Issue #348 · aspnet/Blazor · GitHub
I hope they don't stick with the "current approach" where one has to laboriously do the foolowing for every single function:
// register
Blazor.registerFunction('doPrompt', message => {
return prompt(message);
});
// wrap
public static bool DoPrompt(string message)
{
return RegisteredFunction.Invoke<bool>("doPrompt", message);
}
modified 22-May-18 11:29am.
|
|
|
|
|
I have a question regarding Gridview in asp.net. I need Textbox for particular cell in Gridview column. I am using Visual studio 2015. Whether it is possible.
|
|
|
|
|
You already posted this vague question at [^]. Please post in one forum only.
|
|
|
|
|
|
For example, you can order dishes on handheld devices that run on your Iphone, Androi, winphone, restaurant, coffee shop, and so on. Any programming language that runs on the above devices, for example simple you have to share yourself with.
|
|
|
|
|
|
Hello, new here. I am having some difficulty with claims Identity. The new Item that i have put in the "Add custom user claims here" could be a null or unanswered field during registration. It seems that it does not like that. I am getting a "Object reference not set to an instance of an object". This has no issue when the field in the database has something in it. Below is my code in the IdentityModel.
public string HomeTown { get; set; }
public DateTime? BirthDate { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
userIdentity.AddClaim(new Claim("BirthDate", BirthDate.ToString()));
userIdentity.AddClaim(new Claim("HomeTown", HomeTown.ToString()));
return userIdentity;
}
I have also implemented a IdentityExtensions.cs so that i can pull a GetHomeTown.
I am trying to show HomeTown on the _loginPartial of the MVC. I have tried several flavors of "if" statements. So i am trying to show a actionlink if the there is not a HomeTown in the system and if there is show it.
Here is my code for _loginPartial:
@{
var bday = (User.Identity.GetBirthDate());
var d = Convert.ToDateTime(bday).Date.ToString("d");
var htown = (User.Identity.GetHomeTown());
if (string.IsNullOrEmpty(htown))
{
<li> @Html.ActionLink("Update Info", "Update", "Home")</li>
}
else
{
<li>From @Html.Raw(htown) </li>
}
}
<li>@Html.Raw(d)</li>
Here is the code from the IdentityExtensions:
public static string GetHomeTown(this IIdentity identity)
{
var claim = ((ClaimsIdentity)identity).FindFirst("HomeTown");
return (claim != null) ? claim.Value : string.Empty;
}
I have no issues displaying GetHomeTown when there is something in the field. My "if" statements seem to never work. Some that i have tried will show whatever i put after the "if" statement and just ignore the else. Others do not work at all.
Is there something i am not getting here? Should i be doing this in the AccountController instead and where would i put this if i did?
Maybe in here:
public AccountController()
{
context = new ApplicationDbContext();
}
Thanks in advance for your help. Let me know if there is anything else that you need to see.
Update 12:08 EST 5/5/2018:
I was able to get around this by inserting a default value - html string. This way i do not need the "if" statement and it displays what i need with a link. When the user updates this with a Home Town it will delete the string and show their hometown. I think this is better anyhow.
I did however find out that my code does work if you clear the NULL from the SQL record field to an empty field. I tried putting a default value of ("") but SQL treats it as NULL in the field.
modified 5-May-18 0:15am.
|
|
|
|
|
I figured that since MVC does so much for you that this would be an easy one. However, I can't find a complete solution to do this. I want my index views and detail views, in particular, to display local time instead of UTC time. Or, I will happily hard code Eastern Time since all users are in Eastern time right now. The database stores the values in UTC and the site will be running in Azure.
Does anyone have a good solution for this? How do you all handle displaying times in a different timezone?
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Something like this should work:
Views/Shared/DisplayTemplates/DateTime.cshtml:
@model DateTime?
if (Model != null)
{
string formatString = ViewData.ModelMetadata.DisplayFormatString;
if (string.IsNullOrWhiteSpace(formatString))
{
formatString = "{0:r}";
}
<time datetime="@string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:o}", Model)">@string.Format(System.Globalization.CultureInfo.CurrentCulture, formatString, Model?.ToLocalTime())</time>
} Views/Shared/DisplayTemplates/DateTimeOffset.cshtml:
@model DateTimeOffset?
if (Model != null)
{
string formatString = ViewData.ModelMetadata.DisplayFormatString;
if (string.IsNullOrWhiteSpace(formatString))
{
formatString = "{0:r}";
}
<time datetime="@string.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:o}", Model)">@string.Format(System.Globalization.CultureInfo.CurrentCulture, formatString, Model?.ToLocalTime())</time>
}
NB: This will use the server's local time zone, not the client's. If you want to use the client's, then you'll need to use Javascript to update the <time> elements. For example, using Moment.js[^]:
$(function () {
$("time").each(function () {
var me = $(this);
var time = me.prop("dateTime");
if (time) {
var value = moment.utc(time);
me.html(value.calendar());
me.prop("title", value.format("LLLL"));
}
});
});
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
We have a CPPLUS DVR with 2 way audio setup. We want to develop the web application, through which we have to integrate the DVR and can listen the audio remotely.
If anyone has a solution, please share.
|
|
|
|
|
please help i am getting the error message:
System.ArgumentException: AjaxControlToolkit.RatingExtender missing required StarCssClass property value for Rating2_RatingExtender.
Parameter name: StarCssClass
<title></title>
<style type="text/css">
.Star
body
{
font-family: Arial;
font-size: 10pt;
display: block;
background-repeat: no-repeat;
}
th, td
{
height: 30px;
width: 100px;
}
</style>
<style type="text/css">
.Star
{
background-image: url(images1/Star.gif);
height: 17px;
width: 17px;
}
.WaitingStar
{
background-image: url(images1/WaitingStar.gif);
height: 17px;
width: 17px;
}
.FilledStar
{
background-image: url(images1/FilledStar.gif);
height: 17px;
width: 17px;
Display:Block;
background-repeat:no-repeat;
}
</style>
</head>
<body>
|
|
|
|
|
Member 13802222 wrote: missing required StarCssClass property value for Rating2_RatingExtender
The error message is telling you that you need to set the StarCssClass property on the Rating2_RatingExtender control.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
I am a beginner in vb.net and asp.net.
I have been researching and experimenting a few methods for this one week, none worked, most of the methods will only print one page (current page) in the crystal report.
Meanwhile, the default print button in the crystal report viewer has only the export option, in the pop menu that comes out when the button is clicked.
I want to have an external button in which when its clicked it opens the print preview page, displaying all pages of the report from the crystal report viewer, where the user can select the printer, adjust whatever settings, and choose the pages to be print.
IS THIS EVEN POSSIBLE? what would be the best method? please give me some example code. Thanks in advance
|
|
|
|
|
namespace TestMvcApplication.Controllers
{
public class HomeController : Controller
{
private MYDBEntities1 db = new MYDBEntities1();
// GET: Home
public ActionResult Index()
{
var employees = db.tblEmployees.Include("tblEmployee");
return View(employees.ToList());
}
However, when it tries to load the Index view, I get the following error:
{"A specified Include path is not valid. The EntityType 'MYDBModel.tblEmployee' does not declare a navigation property with the name 'tblEmployee'."}
modified 3-May-18 5:04am.
|
|
|
|
|
You can't learn a new technology by looking at code and asking questions on a forum, you really need to get a book on MVC and go through it, or at least look at some tutorials on-line like the "MVC Music Store" (google it).
The "foreach" is trying to access the "Model" object but your action returns a view with no model so "Model" is null. We don't know what the solution is as we don't know what your code is supposed to do in this situation....either the action is wrong and it should be returning a model but it isn't, or the view is wrong and it should check the model exists before accessing it.
|
|
|
|
|
please am a beginner who want to learn ASP.NET, how will I begin with this platform
|
|
|
|
|
Asking this question today makes little sense, because Microsoft has invested quite a lot in producing some good tutorials online with proper explanation and demonstration.
The tutorials are hands-on, interactive, self-explanatory and most of them are managed by the community and community provides the best insights for beginners to start learning and practicing the standards.
ASP.NET Documentation | Microsoft Docs
You would require to have an IDE — go for Visual Studio 2017 Community edition, install the ASP.NET components and get started. Remember, to learn ASP.NET you need to know the basics of web standards (HTML, CSS, and JavaScript), you also need to know how HTTP works; it is quite simple, really. That article above will guide you with the advanced development using ASP.NET.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
In my opinion, it would be better if you posted this as a reply to their message.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|