|
In any type of foreach loop you pass in a list of items you wish to iterate over.
Check what the types are that you are passing into your foreach loop. What are $result and $data? Check that they are of the correct types.
|
|
|
|
|
Check the content of
$result->data by using
var_dump($result->data);
You will see the content of your object.
However if it is a big object it can be messy
You can also use this piece of code given in the comment section of the Traversable interface:
http://php.net/manual/en/class.traversable.php#99195[^]
|
|
|
|
|
I have developed MVC3 website and deployed it on IIS7 server.
When I test the site just by running it from my solution, the layouts works fine with IE8 and firefox browsers. But once I give the URL which is taken from the server, my design layout is not getting applied to IE8 browser but works fine with firefox.
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" />
" type="text/javascript">
" type="text/javascript">
" type="text/javascript">
" type="text/javascript">
script tags workes fine but the Link tags are not recognized properly in IE8
Please help me to sort this out
Thank you very much
|
|
|
|
|
Hi,
I've installed VS 2013 Professional Edition and created a project as shown below
1. File->New Project
2. Templates->Visual C#->Web->Visual Studio 2012
3. Selected ASP.Net MVC4 Web Application and clicked on OK button
A new project got created. I haven't done any code changes. Run the application using internet Explorer. Its working fine and when I clicked on Login link,
below exception was thrown. Please let me know if I missed anything.
Exception:
<big>An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll but was not handled in user code<br />
</big><br />
Exception occurred in Filters->InitializeSimpleMembershipAttribute.cs
method: OnActionExecuting
Line: LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
Thanks in advance.
modified 9-Oct-14 4:09am.
|
|
|
|
|
It probably means that you have not added the required implementation code for some method that will be called by the framework. Check the MVC documentation, and also look at the place where the exception occurred.
|
|
|
|
|
I haven't done any code changes. I just want to go through the built-in functionality which is ready to use.
Exception occurred in Filters->InitializeSimpleMembershipAttribute.cs
method: OnActionExecuting
Line: LazyInitializer.EnsureInitialized(ref _initializer, ref _isInitialized, ref _initializerLock);
|
|
|
|
|
NarVish wrote: I just want to go through the built-in functionality which is ready to use. Well something is obviously missing, hence the exception. You will need to examine the code more closely to identify the problem. Alternatively you can add an exception handler to help you.
|
|
|
|
|
Step through the code and see where the exception is being thrown. You can then view the full details such as the stacktrace and innerexception which should give you sufficient information to resolve your error.
|
|
|
|
|
Hi all, if I want to dynamically grab the markup of my page after making changes to the DOM using javascript how would I go about it. I know that there are tools out there for viewing the DOM of a page after it has been modified using javascript but I would like to actually grab the new DOM and save it dynamically using code. Thanks in advance for your help.
|
|
|
|
|
You can use outerHTML[^] and innerHTML[^] to get the HTML code for a DOM element and its descendants.
I'm not sure what you mean by "save it dynamically" though - post it back to the server?
|
|
|
|
|
On Windows Server 2008 R2 when the MSSOAPINIT method of the SOAP object is used then the error shown below is thrown
-----------------------------------------
Error Number = -2147352567
Error Short Description = WSDLReader:XML Parser failed at linenumber 0, lineposition 0, reason is: Not enough storage is available to process this command.
HRESULT=0x1: Incorrect function.
- WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057: The parameter is incorrect.
- Client:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.
-----------------------------------------
On further analysis it was found that the web service hosted on the same application can be accessed without any error but if the Web service is on one Web Site in IIS and this Web Service is accessed from another Web Site then the error shown above is thrown. Can anyone please suggest what could be the cause of such issue
modified 16-Oct-14 6:29am.
|
|
|
|
|
Hi everybody,
From past many days I am facing a problem regarding servlet.I am new for SMTP server kind of programs.
My problem is
I developed a page which is called as 'contactus.html' for a website which is dynamic website using java. From contactus page where user enter his details and his comments, those details and comments have to send to a mailid as a mail. I tried with the servlet, but i am facing a problem that if i block my antivirus in my system then only my mail is sending from my website to that particular mailid. If my antivirus is 'on' then mail is not sending instead it is showing SMTP error.
Please give me suggesions to getrid of this problem.
|
|
|
|
|
Hi,
I'm trying to make a list of items responsive.
I havve a container div, wich contains divs with class "itemContainer".
after ever .itemContainer there is a div for clear which I set it to display none;
html :
<div id="itemListPrimary">
<div class="itemContainer">
</div>
<div class="clr"></div>
CSS :
#itemListPrimary {display:block;}
div.itemListPrimary {float:left;}
#itemContainer> .clr {display:none;}
@media (min-width: 960px) {
div.itemListPrimary {width: 33.3% !important;}
}
@media only screen and (min-width: 768px) and (max-width: 960px){ div.itemContainer {width:50% !important;}
}
you can see it here :
www.mykonosexclusivevillas.com/our-villas
there should be 3 items in every row but in the 3rd row it breaks
any suggestions ?
thank you
|
|
|
|
|
Ok, Solved
It had to do with the digerrent height of the itemContainer divs.
I set the height to equal and now it's fine.
thanx
|
|
|
|
|
Hi everyone.
I am well and truly stuck .
I have created a huge list of radio buttons on my razor view. Each row is a different set of radio buttons and I have given them each dynamic names.
I am new to MVC and i did not know how i can pass this radio button list to controller
this is my editor template
@model StudentManagement1.TeacherCourseStudent
@{
ViewBag.Title = "Attendance";
}
<tr>
<td>
@Model.Student_Id
</td>
<td>
@Model.Student.Name
</td>
<td>
@Model.Student.Sur_Name
</td>
<td>
@Model.Student.Semester.Semester_Name
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "present", true)
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "absent")
</td>
<td>
@Html.RadioButton(@Model.Student_Id.ToString(), "leave")
</td>
and this is my Razor view
@model IEnumerable<StudentManagement1.TeacherCourseStudent>
@{
ViewBag.Title = "MarkAttendance";
Layout = "~/Views/Shared/_TeacherLayout.cshtml";
}
@using (Html.BeginForm("MarkAttendance", "Attendance", FormMethod.Post))
{
<table>
<tr>
<th>
Student Id
</th>
<th>
Name
</th>
<th>
Sur Name
</th>
<th>
Semester
</th>
<th>
Present
</th>
<th>
Absent
</th>
<th>
Leave
</th>
</tbody>
@Html.EditorForModel()
</table>
<br /> <br />
<input type="submit" value="Save attendance" />
}
here my controller to which i want to pass values
[HttpPost]
public ActionResult MarkAttendance(IEnumerable<string> Student_Id)
{
return view();
}
modified 4-Oct-14 6:34am.
|
|
|
|
|
help understanding js code
My project is to insert into a database table, records of calculator entries (entry1, operator,
entry2 and the result). I can't sort it out. As I don't understand the js. Is'Accumulate' the
end result (total), I think 'Op' is the (operator) used (am I showing my
ignorance yet/still)? I think curReadOut & ReadOut are the 2 arguments?
<FORM name="Keypad" action="">
<TABLE border=2 width=50 height=60 cellpadding=1 cellspacing=5>
<input name="ReadOut" type="Text" size=24 value="0" width=100%>
<input name="btnClear" type="Button" value=" C " onclick="Clear()">
<input name="btnClearEntry" type="Button" value=" CE " onclick="ClearEntry()">
<input name="btnSeven" type="Button" value=" 7 " onclick="NumPressed(7)">
<input name="btnEight" type="Button" value=" 8 " onclick="NumPressed(8)">
<input name="btnNine" type="Button" value=" 9 " onclick="NumPressed(9)">
<input name="btnNeg" type="Button" value=" +/- " onclick="Neg()">
<input name="btnPercent" type="Button" value=" % " onclick="Percent()">
<input name="btnFour" type="Button" value=" 4 " onclick="NumPressed(4)">
<input name="btnFive" type="Button" value=" 5 " onclick="NumPressed(5)">
<input name="btnSix" type="Button" value=" 6 " onclick="NumPressed(6)">
<input name="btnPlus" type="Button" value=" + " onclick="Operation('+')">
<input name="btnMinus" type="Button" value=" - " onclick="Operation('-')">
<input name="btnOne" type="Button" value=" 1 " onclick="NumPressed(1)">
<input name="btnTwo" type="Button" value=" 2 " onclick="NumPressed(2)">
<input name="btnThree" type="Button" value=" 3 " onclick="NumPressed(3)">
<input name="btnMultiply" type="Button" value=" * " onclick="Operation('*')">
<input name="btnDivide" type="Button" value=" / " onclick="Operation('/')">
<input name="btnZero" type="Button" value=" 0 " onclick="NumPressed(0)">
<input name="btnDecimal" type="Button" value=" . " onclick="Decimal()">
<input name="btnEquals" type="Button" value=" = " onclick="Operation('=')">
</FORM>
<SCRIPT LANGUAGE="JavaScript">
var FKeyPad = document.Keypad;
var Accumulate = 0;
var FlagNewNum = false;
var PendingOp = "";
function NumPressed (Num) {
if (FlagNewNum) {FKeyPad.ReadOut.value = Num;FlagNewNum = false;}
else {
if (FKeyPad.ReadOut.value == "0")
FKeyPad.ReadOut.value = Num;
else
FKeyPad.ReadOut.value += Num;
}
}
function Operation (Op)
{
var Readout = FKeyPad.ReadOut.value;
if (FlagNewNum && PendingOp != "=");
else
{
FlagNewNum = true;
if ( '+' == PendingOp )
Accumulate += parseFloat(Readout);
else if ( '-' == PendingOp )
Accumulate -= parseFloat(Readout);
else if ( '/' == PendingOp )
Accumulate /= parseFloat(Readout);
else if ( '*' == PendingOp )
Accumulate *= parseFloat(Readout);
else
Accumulate = parseFloat(Readout);
FKeyPad.ReadOut.value = Accumulate;
PendingOp = Op;
}
}
function Decimal () {
var curReadOut = FKeyPad.ReadOut.value;
if (FlagNewNum) {curReadOut = "0.";FlagNewNum = false;}
else
{if (curReadOut.indexOf(".") == -1)curReadOut += ".";}
FKeyPad.ReadOut.value = curReadOut;
}
function ClearEntry () {FKeyPad.ReadOut.value = "0";FlagNewNum = true;}
function Clear () {Accumulate = 0;PendingOp = "";ClearEntry();}
function Neg () {FKeyPad.ReadOut.value = parseFloat(FKeyPad.ReadOut.value) * -1;}
function Percent () {
FKeyPad.ReadOut.value = (parseFloat(FKeyPad.ReadOut.value) / 100) * parseFloat(Accumulate);
}
|
|
|
|
|
Please shorten your code... It is hard to read this way...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I've scalped as much as it's readable.
|
|
|
|
|
Hi, I'm trying to clear a database table of data and reset autoindex to 1
<!DOCTYPE html><html>
<head>
<meta charset=utf-8>
<title>database table remove data</title>
</head><body>
=mysqli_connect(=============="; }
if(isset($_POST['total']))
mysqli_query($con,"TRUNCATE TABLE testtbl set id=1");
mysqli_close($con);
?>
|
|
|
|
|
Your syntax is wrong...
TRUNCATE TABLE testtbl set id=1
It should be like this
TRUNCATE TABLE testtbl
In MySQL TRUNCATE TABLE will reset AUTO_INCREMENT counters (before 5.0.3 it's true only if there is not FKs on the table, but since 5.0.3 it happens always regardless of FKs)...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I am programming in c# and html. On the bottom part of the page I would like to show a series of pictures, that need to scroll around. There are about 20 pictures.
I have tried to create a panel in html but am unable to scroll each picture. Any assistance will be appreciated.
<pre lang="SQL">
|
|
|
|
|
Do you mean like this:
This is a picture This is a picture This is a picture This is a picture
if so just add overflow-x, overflow-y, and overflow to css
Help people,so poeple can help you.
|
|
|
|
|
I need them to be next each other, and then be able to scroll across the page.
I will try your advice and let you know the result.
Thanks
Mike
|
|
|
|
|
This is a picture This is a picture This is a picture This is a picture
then add a div with width that contains all the pictures in one row inside your viewport and give your viewport overflow style
Help people,so poeple can help you.
|
|
|
|
|