|
I fixed it. I'm using bootstrap3 and the sample I used was for bootstrap 4 (although it didn't call out v4 anyplace in the sample).
I also found out that I had to include the following in my web config to avoid 404 errors in the javascript when searching for fonts that font-awesome needed:
<system.webServer>
<staticContent>
<remove fileExtension=".woff" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".woff2" mimeType="font/x-woff" />
</staticContent>
</system.webServer>
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You might need more MIME mappings for the other font types:
<mimeMap fileExtension="eot" mimeType="application/vnd.ms-fontobject" />
<mimeMap fileExtension="otf" mimeType="application/x-font-opentype" />
<mimeMap fileExtension="svg" mimeType="image/svg+xml" />
<mimeMap fileExtension="ttf" mimeType="application/x-font-truetype" />
<mimeMap fileExtension="woff" mimeType="application/font-woff" />
<mimeMap fileExtension="woff2" mimeType="application/font-woff2" />
According to this SO thread[^], the official MIME type for Woff2 might have been changed to font/woff2 ; but application/font-woff2 works for now.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for the heads up.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I have started with creating a custom module as mentioned in this tutorial Learn How to Override Block in Magento 2[^] that editing the core files can be a risk so i have created my own custom module but still i am facing problems i don't know what's wrong with the code.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magenticians_Modulecontact" setup_version="1.0.1">
|
|
|
|
|
Hi
Anyone can help me out in this issue.My coordinate are fetching latitude and longitude from database dynamically and that should display as marker everytime when database updates by serial number but it is not displaying.
view:
<?php echo $map['javascript'];?>
<?php echo $map['mapdiv']
model:
function googlemaps($serial)
{
$return=array();
$query=$this->db->select('cycle_serial,cycle_19_INT,cycle_20_INT,cycle_21_INT,cycle_22_INT,cycle_23_INT,cycle_24_INT')->from('cycles')->where(array('cycle_serial'=>$serial))->limit(1)->order_by('cycle_timestamp','DESC')->get();
if($query->num_rows()>0)
{
foreach($query->result_array() as $row)
{
array_push($return,$row);
}
}
return $return;
}
controller:
function Googlemaps($serial)
{
$this->load->library('googlemaps');
$config['minifyJS'] = TRUE;
$config['center'] = '1600 Amphitheatre Parkway in Mountain View';
$config['zoom'] = '15';
$config['geocodeCaching'] = TRUE;
$this->googlemaps->initialize($config);
$coords=$this->dashboard_model->googlemaps($serial);
foreach($coords as $coordinate)
{
$marker=array();
$lat1=$coordinate['cycle_19_INT'].(substr($coordinate['cycle_20_INT'], 0, 2)+(substr($coordinate['cycle_20_INT'], 2).".".$coordinate['cycle_21_INT'])/60);
$lat2=str_replace($coordinate['cycle_22_INT'],'-',$coordinate['cycle_22_INT']).(substr($coordinate['cycle_23_INT'], 0, 2)+substr((substr($coordinate['cycle_23_INT'], 2).".".$coordinate['cycle_24_INT'])/60,0,7));
$lat=$lat1.','.$lat2;
$marker['position']=$lat;var_dump($marker['position']);
$this->googlemaps->add_marker($marker);
}
$data=array();
$data['map'] = $this->googlemaps->create_map();
$this->load->view('dashboard/dashboard_googlemap_view', $data);
}
|
|
|
|
|
Does anyone use this? It changes routing to be namespace-centric and groups controllers and their related views into a given namespace.
I'm not sure how this would improve things over just creating a folder and moving the controller/views into it without changing the namespaces you're already using. It also wouldn't affect the routing as far as I can determine.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I found that it doesn't lend any real value for my projects, but I'm a shop of one. For large projects with multiple contributors I can see where the value would come in.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Will Visual Studio complain if I simply move, the controller to the associated view sub-folder without changing the namespace in the controller?
EDIT =========================
The answer is no. The app acts exactly the same and there's no compiler push-back at all.
That will at least keep me from having to scroll up to get to the controller when I'm busy making the views fail spectacularly.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Yeah, it's not as smart as that. Unless you're actually using the areas mechanic it's just reflecting objects that inherit from Controller and trimming the "Controller" portion of the name. 100% standards-based approach.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
How do you specify a route with multiple parameters that are NOT part of the URL itself?
like this:
controller/action?param1=a¶m2=b¶m3=c
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
If they're not being used to select the controller or action, then you shouldn't need to include them in the definition of the route. MVC will "magically" fill in the action parameters from the route data, the query string, and the POST body.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yeah, I fingered that out about an hour after posting. I generally despise "magic".
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Can someone please give a hand?
I am stumped on this.
In ASP.NET, for instance, if you have the following dropdownlist:
<ASP:DropDownList ID="DropDownList1" runat="server">
ListItem Value="Pastorsname">PastorName</ListItem>
</ASP:DropDownList>
and I wish to grab the text called PastorName and insert into the database, all I would need to do is this simple syntax:
DropDownList1.SelectedItem.Text
I am trying to do something similar in PHP:
<table id="dataTable">
<tbody>
<tr>
<td>
<?php
$conn=mysqli_connect("localhost","xphiasuser","xphiasadmin","xphias_sermon");
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$select_query="Select pastorname, ministryname from xphias_clients";
$select_query = mysqli_query( $conn,$select_query);
echo "<select name='pastorsname' id='pastorsname' class='form-control'>";
echo "<option value=' '></option>";
while ($rc= mysqli_fetch_array($select_query) )
{
echo "<option value='" .$rc['ministryname'] . "'>" . $rc['pastorname'] . "</option>";
}
echo "</select>"; ?></td>
<td><INPUT TYPE="TEXT" class="form-control" NAME="ministriesname" id="ministriesname" SIZE="16"></td>
<td><INPUT TYPE="TEXT" class="form-control" NAME="sermondate" SIZE="10"></td>
<td><INPUT TYPE="TEXT" class="form-control" NAME="sermonname" SIZE="16"></td>
<td><INPUT INPUT="TEXT" class="form-control" NAME="scriptures" SIZE="16"></td>
<td><INPUT INPUT="TEXT" class="form-control" NAME="videoname" SIZE="10"></td>
<td><INPUT INPUT="TEXT" class="form-control" NAME="sermonnotes" SIZE="16"></td>
</tr>
</table>
<table>
<tr>
<td><INPUT type="file" class="form-control" name="fileToUpload" /></td>
<td><INPUT TYPE="submit" value="Save" SIZE="14" name="upd"></td>
</tr>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
$('#pastorsname').change(function(){
var ministriesname = $(this).val();
$('#ministriesname').val(ministriesname);
});
});
</script>
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$sql = "INSERT INTO xphias_sermons (pastorname, ministriesname, sermon_name, scripture, video_name, sermon_notes,sermon_date)
SELECT ministryname, pastorname, ?, ?, ?, ?, ? FROM xphias_clients WHERE ministryname = ?;
// VALUES (?, ?, ?, ?, ?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param('sssssss', $pastorname, $ministriesname, $sermonname, $scriptures, $videoname, $sermonnotes, $sermondate);
}
$pastorname = $_POST['pastorsname'];
$ministriesname= $_POST['ministriesname'];
$sermondate = date('Y-m-d H:i:s', strtotime(str_replace('-', '/', $_POST['sermondate'])));
$sermonname= $_POST['sermonname'];
$scriptures= $_POST['scriptures'];
$videoname= $_POST['videoname'];
$sermonnotes= $_POST['sermonnotes'];
In this PHP code, the <select...>.., the SELECT Value is pastorname and the text is ministryname.
How do I grab the value of text of ministryname and insert that into the database?
Your help is greatly appreciated.
|
|
|
|
|
var elt = document.getElementById(elementId);
return elt.options[elt.selectedIndex].text; The correct javaScript dom access can be determined from the bold text, above, after you modify it to your purposes.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
|
I hardly remember even answering this.
There are always packages for pretty much everything.
Tell someone the answer is "get a package" is occasionally appropriate but the answer I gave also allows the poster to learn something about what's going on.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Don't worry - "Sarah" is a spammer.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Fully patched Win7
VS2013/5
.Net 4.5
EF6.2
MVC5
Everything has been going almost okay up until today. All of a sudden, when I try to add a new controller with views, I get this:
There as an error running the selected code generator:
"Exception has been thrown by the target of an invocation."
I was able to add a new controller yesterday with NO PROBLEM with the same dbcontext .
---------------
In the web.config (which has not change since I started the project):
1) There are no instances of "configsource" in the sections.
2) The configSections element is the first element.
3) The entityframework section looks correct (some people have had the wrong provider specified).
4) None of the sections are duplicated.
I've tried the following, and STILL have the problem.
1) The model object appears to be defined correctly, and is implemented as a DbSet<> in the dbcontext ).
2) I tried changing the model implementation in the dbcontext to IDbSet<> .
3) I tried adding a controller (with a different name, of course) for a model that I already created a controller for.
4) I updated EF6 to from 6.13 to 6.2 out of desperation.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I've done everything but start the project over, and I'm not inclined to do that...
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Hi everyone, I have a bootstrap tabs inside an updatepanel, i put in a javascript to keep the status of the tab after postback but this causes the following error on every callback:
Sys.WebForms.Res is undefined
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="Tabs" role="tabpanel">
<div class="row row-text">
<div class="col-md-4">
<p class="h5">
search
Effettua Ricerca per:
</p>
</div>
<div class="col-md-8 flex">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#rapida" aria-controls="home" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'rapida';">Ricerca rapida</a></li>
<li role="presentation"><a href="#tecnica" aria-controls="profile" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'tecnica';">Ricerca tecnica</a></li>
<li role="presentation"><a href="#veicolo" aria-controls="messages" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'veicolo';">Ricerca veicolo</a></li>
</ul>
</div>
</div>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="rapida">
<div class="row">
<div class="col-md-11">
<asp:TextBox ID="SearchText" runat="server" CssClass="form-control"></asp:TextBox>
</div>
<div class="col-md-1 no-padding-l">
<asp:Button ID="SearchTextStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="tecnica">
<div class="row">
<div class="col-md-11">
<asp:DropDownList ID="SearchCategory" class="form-control" runat="server"></asp:DropDownList>
</div>
<div class="col-md-1 no-padding-l">
<asp:Button ID="SearchCategoryStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="veicolo">
<div class="row">
<div class="col-md-11">
<div class="col-md-6">
<asp:DropDownList ID="SearchBrand" runat="server" CssClass="form-control" AutoPostBack="true" EnableViewState="true"></asp:DropDownList>
</div>
<div class="col-md-6 no-padding-l">
<asp:DropDownList ID="SearchModel" runat="server" CssClass="form-control"></asp:DropDownList>
</div>
</div>
<div class="col-md-1 no-padding-l">
<asp:Button ID="SearchModelStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
</div>
</div>
</div>
</div>
</div>
<asp:HiddenField ID="TabName" runat="server" ClientIDMode="Static" />
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
$(function () {
SetTabs();
});
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
SetTabs();
}
});
};
function SetTabs() {
var tabName = $("[id*=TabName]").val() != "" ? $("[id*=TabName]").val() : "personal";
$('#Tabs a[href="#' + tabName + '"]').tab('show');
$("#Tabs a").click(function () {
$("[id*=TabName]").val($(this).attr("href").replace("#", ""));
});
};
</script>
in codebehind :
If Me.IsPostBack Then
TabName.Value = Request.Form(TabName.UniqueID)
End If
modified 8-Nov-17 11:51am.
|
|
|
|
|
When I click logoff, it does not log the user off (it doesn't even hit the method in the Account controller).
In IE11 it's fine. WTF?!!!
Furthermore, EVERY other link is a MVC actionlink, but "Logoff" is this:
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
What's the reason for that?
BTW, I'm using Chrom 61.0.3163.100. I know the latest version is 62...., but I don't have permissions to update it at work.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
modified 7-Nov-17 8:24am.
|
|
|
|
|
John Simmons / outlaw programmer wrote: What's the reason for that?
Because that's how it's declared in Views\Shared\_LoginPartial.cshtml :
@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
{
@Html.AntiForgeryToken()
<ul class="nav navbar-nav navbar-right">
<li>
@Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li>
<li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
</ul>
}
}
else
{
...
It's using a <form> because the LogOff action in the AccountController requires a POST request:
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult LogOff()
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
return RedirectToAction("Index", "Home");
}
This is done to prevent a forged request from another site from logging the user out of your site. If you're not worried about that, you could remove the [HttpPost] and [ValidateAntiForgeryToken] attributes to make the action accept a GET request, and then remove the form:
@using Microsoft.AspNet.Identity
@if (Request.IsAuthenticated)
{
<ul class="nav navbar-nav navbar-right">
<li>
@Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" })
</li>
<li>
@Html.ActionLink("Log off", "LogOff", "Account")
</li>
</ul>
}
else
{
...
public ActionResult LogOff()
{
AuthenticationManager.SignOut(DefaultAuthenticationTypes.ApplicationCookie);
return RedirectToAction("Index", "Home");
}
Otherwise, you'll need to work out why the javascript: link isn't working in Chrome. The developer console (F12) might have some clues.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
In chrome, I have this:
Refused to load the script '[script name]' because it violates the following Content Security Policy directive: "script-src 'none'".
For each for the following scripts:
modernizr-2.8.3.js
jquery-3.2.1.js
bootstrap.js
respond.js
browserLink (wtf is that?)
It says it refused to load those scripts, but everything else appears to work fine.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
|
No, I haven't set one because I wasn't aware that I need too.
By addons, do you mean nugget packages?
How would I be able to determine that?
(all of the above could also be asked like this - "How the f*ck should I know?")
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|