|
|
In a vb.net 2010 web form application the user loads 'template letters' to a web inerface, so that they can modify letters sent out to various customers to generate various late pay notifications. The user basically selects the 'template letter' they want to generate for a specific customer, and hits the 'save' button.
The web interface has the tabs for 'preview', 'html', and 'design' as the bottom of the editor. These tabs are not part of any custom code, they must be part of a web interface that is inherited.
The values for the editor are stored in a sql server 2012 database in a field called 'strTemplate' and the value is actually html.
The problem is once the html value for 'strTemplate' is loaded for the user to edit, extra blank lines are loaded between different parts of the 'templates'. Basically extra
tags are generated.
When the user hits the save button, more
tags are generated between the various parts of the letter.
I do not want these extra blank lines to be generated.
I have gone into the html tab, removed the
tags and hit the save button. The extra tags are still generated. I have stepped through the code to find where the tags are generated and can not find it.
Thus can you tell me what I can do to not have the extra
tags generated?
The following is some of the code that is used when accessing the part of that gets to the web interface:
Imports System.Data
Imports System.Reflection
Imports System.Windows.Forms
Imports Telerik.Web.UIImports System.Web.Script.Services
Imports System.Web.Script.Serialization
Imports System.Web.Services
Partial Class edittemplates_default
Inherits System.Web.UI.Page
Protected _master As MasterPage
#Region "Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
MyBase.Load _master = CType(Page.Master, MasterPage)
_master.PageTitle = "Edit Templates" If Not Page.IsPostBack Then
If (SiteUserManager.SessionUser IsNot Nothing) Then LoadTemplates()
LoadVariables()
Else 'pnlEditor.Enabled = False
'pnlEditor.Visible = False End If
End If Master.Page.Title = "Login" End Sub
#End Region#Region "Protected Sub LoadTemplates()"
Protected Sub LoadTemplates()
Dim et As EditTemplates = New EditTemplates()
Dim dt As DataTable = et.SelectTemplates() For i = 0 To dt.Rows.Count() - 1
ddlTemplates.Items.Add(New ListItem(dt.Rows(i)(dt.Columns(1).ColumnName()), dt.Rows
(i)(dt.Columns(0).ColumnName())))
Next End Sub
#End Region
#Region "Protected Sub LoadVariables()"
Protected Sub LoadVariables()
Dim et As EditTemplates = New EditTemplates()
Dim dt As DataTable = et.SelectAtnLtrVariables() For i = 0 To dt.Rows.Count() - 1
rlbVariables.Items.Add(New RadListBoxItem(dt.Rows(i)(dt.Columns(1).ColumnName()),
dt.Rows(i)(dt.Columns(0).ColumnName())))
Next End Sub
#End Region
#Region "Protected Sub btnSaveTemplate_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSaveTemplate.Click"
Protected Sub btnSaveTemplate_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles btnSaveTemplate.Click
Dim et As EditTemplates = New EditTemplates()
If ddlTemplates.SelectedValue <> 0 Then
et.UpdateTemplate(ddlTemplates.SelectedValue, ddlLanguage.SelectedValue,
rEditor.Content.ToString())
End If
End Sub
#End Region
-------------------
Partial Class edittemplates_default
Inherits System.Web.UI.Page
Protected _master As MasterPage
-----------
|
|
|
|
|
Hi, The following code selects and displays a record from the "emailtbl" table
as desired except for the the date and it doesn't update the "lastused" (date)
field to the "numbers" table via "lastused.php" include. No error messages. I need help.
<pre lang="PHP"><html><head>
</head>
<BODY>
="''"=mysqli_connect(==============";}
// ==========This creates the drop down box using records in the table
echo "<select name= 'target'>";
echo '<option value="">'.'---select email account ---'.'</option>';
$query = mysqli_query($con,"SELECT target FROM emailtbl");
$query_display = mysqli_query($con,"SELECT * FROM emailtbl");
while($row=mysqli_fetch_array($query))
{ echo "<option class=highlight value='". $row['target']."'>".$row['target']
.'</option>';}
echo '</select>';
?>
<input type="submit" name="submit" value="Submit"/>
</form>
= ' '= $_POST[="SELECT target, username, password, emailused, lastused, purpose, saved FROM emailtbl WHERE target = '$name'"= mysqli_query($con,$fetch);
================================"1"'.'<tr>'.'<td bgcolor="#FFD47F" align="center">'. 'email menu'. '</td>'.'</tr>';
echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'<td bgcolor="#ccffff">'.'target'.'</td>'.'<td bgcolor="#ccffff">'.'username'.'</td>'.'<td bgcolor="#ccffff">'. 'password' .'</td>'.'<td bgcolor="#ccffff">'. 'emailused'. '</td>'.'<td bgcolor="#FFD47F">'. 'lastused' .'</td>'.'<td bgcolor="#ccffff">'. 'purpose'. '</td>'.'<td bgcolor="#ccffff">'. 'saved' .'</td>'.'</tr>';
// while( $row = mysqli_fetch_assoc( $result ) )
// while($data = mysqli_fetch_row($fetch))
while($data=mysqli_fetch_row($result))
{echo ("<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td><td>$data[4]</td><td>$data[5]</td><td>$data[6]</td></tr>");}
echo '</table>'.'</td>'.'</tr>'.'</table>';
}
?>
</body></html>
lastused.php
?php
error_reporting(E_ALL);
ini_set('display_errors', true);
if(!empty($_POST['update_lastused']))
{
$dbconnect = mysqli_connect('localhost','root','cookie');
mysqli_select_db($dbconnect, 'homedb') or die( "Unable to select database");
$sql = "UPDATE emailtbl SET lastused = NOW() WHERE id = ?";
$stmt = mysqli_prepare($dbconnect, $sql);
if($stmt == false)
{throw new Exception("Prepare failed".PHP_EOL.mysqli_error($dbconnect).PHP_EOL.$sql);}
mysqli_stmt_bind_param($stmt, 'i', $sql);
$update = mysqli_stmt_execute($stmt);
if($update == false)
{throw new Exception("Update failed:".PHP_EOL.mysqli_stmt_error($stmt).PHP_EOL.$sql);}
}
?>
|
|
|
|
|
Things look wrong starting at mysqli_stmt_bind_param to me - you're binding the $sql variable to the parameter, and not setting the ID value to use before calling execute on the prepared statement.
Take a look at the examples on the manual page, it should become clearer: http://uk.php.net/manual/en/mysqli-stmt.bind-param.php[^]
|
|
|
|
|
This seemed to be a better approach but I can't get it to work either. I'm trying to change from MYSQL but having trouble ?
connect_error) die (
'Connect Error (' . $db->connect_errno . ') ' . $db->connect_error
);
if (!empty($_POST['update_lastused']))
{
$stmt = $db->prepare('
UPDATE emailtbl
SET lastused = NOW()
WHERE id = ?
');
$stmt->bindParam('s', $_POST['id']);
if ($stmt->execute())
{
echo "";echo "Last access is:";
echo $lastused;echo "";
}
else {echo 'There was a problem setting lastused" - ', $stmt->error;}
}
?>
|
|
|
|
|
Hi,
Am new to MVC.I need Sample Mvc 4 Application t Insert data into the database and Bind Them to grid.
Thanks in Advance
Nanthini
|
|
|
|
|
You should use Google for such kind of generic questions. You will get many such samples.
If you are facing problem in your implementation, please post your pin point problem and we are there to help.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
|
I have 30 years development experience. I do C# and WPF. I have some experience with MVC 4 Web API's. It's time for me to transition into web development.
I want to learn ASP.Net MVC. I did get into MVC 4 a while back never went too far.
The question... What is the .Net stack I need to learn? I don't really know what technologies I need.
Thanks
If it's not broken, fix it until it is
|
|
|
|
|
I would suggest to start with a basic .net book. Then dive deeper into code according to your need.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
A basic .Net book??
Why? I have 30 years development experience, including 12 years doing C# & WPF.
.Net isn't an issue for me
If it's not broken, fix it until it is
|
|
|
|
|
Oh!! my mistake. I didn't notice that.
Get an Asp.Net MVC book and read abt its architecture and patterns. At your experience, i think, you can finish it as a story in few hours.
I think, this should be sufficient for you to start with.
Moreover, asp.net/mvc website is also a good place to start.
Life is a computer program and everyone is the programmer of his own life.
|
|
|
|
|
Ok, thanks
If it's not broken, fix it until it is
|
|
|
|
|
|
|
I am pleased to see that you have 30 years of experience and you want to learn MVC.
I was starting MVC before 8 months ago and it was wonderful experience to learn .
My learning path was
1) I started with some small samples on http://www.asp.net/mvc[^] on almost all topics.
2) JavaScript
3) JQUERY
4) AJAX ($.Ajax)widly used (http://api.jquery.com/jquery.ajax/[^])
5) JSON
6) Entity Framework
|
|
|
|
|
One thing that has not been mentioned much here is that when you are working with WebAPI(2), you also need to keep in mind the consumption of your services.
When considering the modern SPA or service-to-service approach, I find it helps to tack it to an n-tier model for the purposes of figuring out what my needs at any given point in the stack are. The WebAPI can serve 2 purposes, data layer only or data mixed with business. The consumer can be considered in the same way, if it's an SPA then the consumer is either UI only or UI-business.
If you're trying to develop a framework, I'd flesh out the approach that I wanted to take and find(or write) a JS framework that best serves my approach. I like using WebAPI2 as a Data source, so I've been working with Angular to handle business and presentation logic. I have other apps that I base out of MVC instead, and just use jQuery/vanilla JavaScript with those.
I do think that the JavaScript environment is one that needs to be considered carefully when moving into the modern web app landscape.
|
|
|
|
|
It sounds like you already have a good base to work if you have previous experience using C#, MVC, WebAPI and WPF.
If you want to get further into web development then look into ASP.NET with / without MVC. Start with the basics and then progress into more complex data-driven / ecommerce systems.
|
|
|
|
|
I built a web site for a company. A few months ago, the company owners split, and one of them started up a new company (new domain and everything), and I used the site code from the original web site, but changed some logos, and changed (what I thought was) all instances of the old name to the new name. We left the original site up with a redirect to the new site.
Now, when we search google for the company new name, it still finds the old site.
The old company name is "South Texas Performance".
The new company name is "Two Ten Performance".
When I google "two ten performance", it finds "south texas performance".
Can someone please tell me how to fix this?
".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
|
|
|
|
|
|
Seems OK to me - a search for "Two Ten Performance" is finding the right site, and a search for "South Texas Performance" is listing both, with the old site first.
Does the page really need 184 Javascript includes though? (Yes, really - document.scripts.length == 184)
|
|
|
|
|
Google will report it's findings based on the data it holds from the last time it crawled your web site. Google (or indeed any search engine) doesn't work in real time but based upon data it holds from crawling web sites. As web sites get updated and change, so the information that Google holds will likewise get out of date, until the next time it crawls your site.
|
|
|
|
|
In many situations developers need to complete web projects in short time or deadline and requirements are many.
Clients don't like compromising quality.
How to handle such situation?
Thanks
|
|
|
|
|
|
You can deliver only two of them:
fast, cheap, good.
Let the customer select the pair he prefers.
|
|
|
|