I am using iTextSharp with Asp.Net MVC and when i am adding a anchor tag in html table,I am getting this error.
Error :-
Unable to cast object of type 'iTextSharp.text.html.simpleparser.CellWrapper' to type 'iTextSharp.text.Paragraph'.
If I remove this anchor tag then i am not getting this error.
This is my html table.
<table>
<tr>
<td>
home
</td>
</tr>
</table>
Please Help..Thanks..!!!
Better to use "MvcRazorToPdf"
Please download complete code from,
https://github.com/andyhutch77/MvcRazorToPdf
Related
After my user adds a new list item with my custom list page, Sharepoint 2007 redirects them to AllItems.aspx. I want them to go the the custom page ThankYou.aspx instead.
My buttos are the standard buttons generated by SharePoint Designer
<table>
<tr>
<td width="99%" class="ms-toolbar" nowrap=""><IMG SRC="/_layouts/images/blank.gif" width="1" height="18"/></td>
<td class="ms-toolbar" nowrap="">
<SharePoint:SaveButton runat="server" ControlMode="New" id="savebutton2"/>
</td>
<td class="ms-separator"> </td>
<td class="ms-toolbar" nowrap="" align="right">
<SharePoint:GoBackButton runat="server" ControlMode="New" id="gobackbutton2"/>
</td>
</tr>
</table>
I have seen several solutions that require adding 150 lines of JavaScript or changing the underlying SharePoint code, and I just can't believe that is the solution - I think either it is so simple that no one has written about it, or I am using the wrong search term to look for it.
I was just overlooking something simple.
The Source parameter on the form link will change the redirect for you. So if your custom form is at
https://myserver/lists/customadd.aspx
Then you can just add the source parameter and Sharepoint will redirect there on submit:
https://myserver/lists/customadd.aspx?Source=ThankYou.aspx
I recently update Dart to Dart SDK version 0.7.1.0_r27025 and have not been able to get conditional templates inside tables to work. The code I have at the moment is:
<td template if="loaded">
<p>Loading</p>
</td>
<td template if="!loaded">
<div>...</div>
</td>
However, if I run that in dartium and inspect the DOM all I see is
<td></td>
<td></td>
and I get a RangeError in the code that was generated by build.dart.
Has something changed in how dart handles conditional templates in tables in the latest release?
I was able to fix this by doing
<td>
<template if="!loaded">
<p>Loading...</p>
</template>
<div id="my_id"></div>
</td>
It seems it is no longer necessary to use the template as an attribute in tables.
We have an email currently being created in back end code (C#) and sent through the ExactTarget API. I want to move this into a template in ExactTarget so that we don't have to maintain HTML written in StringBuilder() in C#. The issue is the content of the email is determined by what a user inputs. The user fills out a form of what samples they want then an email is sent to a person to fulfill the order.
So an example would be:
<tr>
<td>Product Number</td>
<td>Quantity</td>
</tr>
<tr>
<td>Product Number</td>
<td>Quantity</td>
</tr>
The maximum number of samples that can be ordered is 16. Is there a way to loop through content posted to ExactTarget to create the correct number of rows instead of hard coding 16 rows into the template and half of them being blank.
Please let me know if I need to be more specific about anything
You try just creating a Partial View as below,
#model IEnumerable<CartItems>
<table>
#foreach(var item in Model)
{
<tr>
<td>#item.Number</td>
<td>#item.Quantity</td>
<tr>
}
</table>
Call it from your C# Code as He suggested Here. Render a view as a string
As jordanm mentioned, here is an example in the ExactTarget documentation that covers this. You pass the custom input as XML during your triggered send and parse it / inject it into the HTML with AMPscript.
http://help.exacttarget.com/en/documentation/exacttarget/content/ampscript/using_ampscript_with_the_web_service_api/passing_content_to_a_triggered_send_message_at_send_time/
It is possible to call a Grails' tag inside another one using the following synthax.
<g:aContainingGrailsTag value="${aContainedGrailsTag(attr:'whatever')}"
Is it possible to include a custom tag into a Grails tag using the exact same syntax.
I am trying it this way:
<td class="${redOrGreen(number:'i')}"> </td>
but it does not work.
Any insight on this greatly appreciated.
In this specific case, you can do it like this:
<td class="<yourNameSpace:redOrGreen number='i' />"> </td>
or in general:
<td class="${yourNameSpace.redOrGreen(number:'i')}"> </td>
Only for tags within g: can be called without namespace prefix.
We have two separate front end projects for the same company which are basically the same except for all the html and css. (Different divisions within the same company) I'm trying to add a page that was built in one over to the other. (Yes, yes, I know we probably should've built a single app that display different presentations based on which division's instance was running so that we wouldn't have to maintain two separate but the same codebases, but we just can't go there with this client.)
Anyway, I copied over the controller, the model, and the aspx and ascx pages. All I needed to change was the name on the root namespace. For some reason, a particular ascx page that compiles successfully in the first project, fails in the second project.
Here's the error message:
e:\pathtocode\Web\Views\EmailToFriend\Email.ascx(24): error CS1061:
'System.Web.Mvc.HtmlHelper<MainWeb.Models.EmailToFriend>' does not contain a definition for
'TextBox' and no extension method 'TextBox' accepting a first argument of type
'System.Web.Mvc.HtmlHelper<MainWeb.Models.EmailToFriend>'
could be found (are you missing a using directive or an assembly reference?)
Here's the code for the ascx:
<%# Control Language="C#" AutoEventWireup="true" CodeBehind="Form.ascx.cs"
Inherits="MainWeb.Views.EmailToFriend.Form" %>
<%# Import Namespace="System.Web.Mvc" %>
<table>
<span class="error" style="color: red;">
<%= Model.ErrorString %>
</span>
<tr>
<td>Friend's Name: </td>
<td><%= Html.TextBox("RecipientName", Model.RecipientName)%></td>
</tr>
<tr>
<td>Friend's Email Address: </td>
<td><%= Html.TextBox("RecipientAddress", Model.RecipientEmail)%></td>
</tr>
<tr>
<td>Your Name: </td>
<td><%= Html.TextBox("SenderName", Model.SenderName ?? UserName)%></td>
</tr>
<tr>
<td>Your Email Address: </td>
<td><%= Html.TextBox("SenderAddress", Model.SenderEmail ?? UserEmail)%></td>
</tr>
<tr>
<td>Message</td>
<td><%= Html.TextArea("Message", Model.Message) %></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Send" style="float: right;"/></td>
</tr>
</table>
I've been futzing around with everything I could think of. Html.TextBox works fine in other files in the same project, so I can't figure out why this is blowing chunks.
UPDATE
I've just discovered that in the project where this code works, VS recognizes the project as an MVC web application, but in the second one where it doesn't work, VS does not recognize that it's MVC. At least if I right click on a Views subfolder the former has a context menu item for 'New View', where the latter project doesn't have this.
Now all I have to do is figure out how to turn it into an MVC project, and maybe that will fix it.
UPDATE #2
Drat, that didn't work. I modified the Import directive to use System.Web.Mvc.Html, and now at least intellisense shows the definition for the .TextBox extension - will try restarting the box to see what happens. :(
final update
As I posted in the comments, I found the error and it had to do with a completely different file, so it was basically my mistake and not a code problem. :(
Are you sure Form (as in Inherits="MainWeb.Views.EmailToFriend.Form") inherits from MVC's ViewPage base class?
My guess is you either want to have
Inherits="System.Web.Mvc.ViewPage"
or
namespace MainWeb.Views.EmailToFriend
{
public class Form : System.Web.Mvc.ViewPage
{
}
}
Most likely you also don't need CodeBehind="Form.ascx.cs". Did you add a regular web form instead of MVC view to your project?
Have you made sure that the compiler is set to 3.5 in the codedom section of the web.config? I battled for hours trying to figure out why I could not use html helpers, most posts are advising to add the System.Web.Mvc.Html namespace which is neccessary for the intellisense, yet since the pages aren't compiled until they are rendered you don't realise that this is false security. Here is a post to fix the compiler version issue: Problem creating my own extension to HtmlHelper