|
per78 wrote: Is it not possible to solve this challenge without being a hack?
It's not really a hack. Shameel's problem is that you could theoretically use the mechanism to hack other people's systems using your player as a means of communication. As I said, any application is capable of doing this without communication from the web server at all. Pretending for one moment your intent is malicious, all the remote functionality would give you is control over what the "trojan" player does on the client machine.
Extending functionality pretty much always increases risk of one form or another, you need to work to a level you think is right/ applicable. The real risk is that others will use your software to get access to your system somehow, but good design will reduce this risk right down.
If this Player is just for you and your friends you don't need to worry unduly about external hack attempts, especially if the site is hosted, and communicates, on a local network. In this case I'd suggest a basic web service on the Player side that has methods for each function you want to access remotely.
|
|
|
|
|
Hello
I know you can check who owns a particular domain via whois (if it's not a private registration) - but what about history of domain ownership?
Thanks
dev
|
|
|
|
|
The only source I am aware of is DomainTools.com. Tracking history is a matter of making reqular queries and storing the results, which takes database space. In other words, they offer this as a premium, paid membership only service.
I don't know of any free sources for this information.
|
|
|
|
|
Hi,
I need a DB2 provider for .NET and then please suggest how can i access the DB2 physical file in db2 stored procedure.
Example:
physical file CUSTMAST in Db2.
Guhananth.S
|
|
|
|
|
how to add dotfuscated output to web setup project in vs2008
|
|
|
|
|
I have a class file called MyDropDownList.vb which extends the asp.net DropDownList control in App_Code folder.
Public Class MyDropDownList
Inherits System.Web.UI.WebControls.DropDownList
' my codes
End Class
How can I register MyDropDownList in web.config and use it in my pages?
Thanks,
modified on Friday, August 26, 2011 2:07 AM
|
|
|
|
|
You can register user control either in web.config file or in the web page where you want to use the control.
To register in web.config
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="prefix" src="path of the control" tagName="tag name"/>
</controls>
</pages>
</system.web>
</configuration>
To register in page at this line at the start of the page:
<%@ Register TagPrefix="prefix" src="path of the control" TagName="tag name"/>
Hope this helps.
All the best.
I quit being afraid when my first venture failed and the sky didn't fall down.
|
|
|
|
|
|
Hi Pravin, thanks for the reply but it doesn't work. The error message is the app_code is a special directory. Now i move the file to controls folder but the it is still in issue.
Here is my web.config setting
<add tagPrefix="sastra" tagName="MyDropDownList" src="~/controls/MyDropDownList.vb" />
and here is the error message:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The file 'src' is not a valid here because it doesn't expose a type.
Source Error:
[No relevant source lines]
Source File: none Line: 0
Version Information: Microsoft .NET Framework Version:2.0.50727.4961; ASP.NET Version:2.0.50727.4955
|
|
|
|
|
I am working in visual studio 2010 I have a tab container with five tabs on one of the tabs i have a table in a repeater. I need to be able to insert a record. The problem is when the page loads the table does not display due to no data. I need a blank table to enter the data. Then click a button and add another table and another and so on. This takes place be fore the insert. Is there a better way to accomplish this. I am not seeing allot on inserting with repeater. I need to add multiple customers before insert. Any suggestions would be greatly appreciated. I need to have a layout in table form a grid will not work. Thanks in advance
|
|
|
|
|
Generally you would use the footer template to add controls with which to insert records into your data source. This will place your insert at the bottom of the layout, use the header template if you want it the top, and be visible regardless of whether data is present.
No comment
|
|
|
|
|
I placed the table in the footer template still nothing showing to add record.
|
|
|
|
|
Make sure to add an empty row to your datasource before binding. There needs to be something to trigger the control to use the templates.
No comment
|
|
|
|
|
When I load the tab container there is no connection to the datasource. I need to start with the insert there are no records to bring back. Would that make a difference? In the repeater I have about table with about 30 fields and a few dropdowns. Could you post a small sample. I have a repeater to view the records already entered. I really like the way this repeater works. Just not seeing much in the way of examples starting with no records and inserting.
|
|
|
|
|
I'll honestly try putting an example together but I have many other duties so it may take me a day or two.
No comment
|
|
|
|
|
I would greatly appreciate when you get time.
|
|
|
|
|
|
hey i have a table under the repeater like shown below in the code. Now my problem is there showing the empty rows too along with the data from that table value "TotalAmount". So i am wondering if I could be able to put the condition under that table. some thing like if value equals null, delete the table cell or else show the table cell kind of thing. Is there any way I can do this?
<asp:Repeater ID="rptTotAmount" runat="server">
<ItemTemplate>
<div style="page-break-after:always;">
<asp:Table ID="tblItemListt" runat="server" Font-Size="8%">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right"><%# DataBinder.Eval(Container.DataItem, "TotalAmount", "Total: {0:c}")%></asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</ItemTemplate>
</asp:Repeater>
suchita
|
|
|
|
|
I'm not sure if I understand. You have a table with one cell in each row and want to hide the cell when it is empty? In that case, why not just remove the empty rows from the datasource before binding?
I know the language. I've read a book. - _Madmatt
"The OP herself was not sure about her question"
"The OP is from India and I know what she meant."
|
|
|
|
|
its not the database which has empty data... i got these problems when i try to join multiple tables...
suchita
|
|
|
|
|
SayamiSuchi wrote: i got these problems when i try to join multiple tables
Then how can it not be the database? How are you joining the tables? Are you using an INNER JOIN or an OUTER JOIN? No matter, you can still filter out the empty rows before binding to the repeater.
No comment
|
|
|
|
|
no i am just using nested repeaters
suchita
|
|
|
|
|
OK, lets start from the beginning. Where is the data coming from? What nested repeaters? You have only shown one.
No comment
|
|
|
|
|
Ok. I have database something like this: For pdf I have used iTextSharp 4.2.1.0 version. pdf part is working fine but pdf page break is where I got problem.
table one is
CustomerOrder
--------------
FirstName
LastName
GroupName
Email
CreationDate
second table is
OrderItem
------------
ID
OrderID
Item
ItemDescription
Category
Amount
CustomerID
IsActive
Now my design page is like this:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MainPage.aspx.cs" Inherits="iTextSharpExample._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="pdfReportFromDatabase" runat="server" onclick="pdfReportFromDatabase_Click" Text="Button" />
<div>
</div>
<asp:Repeater runat="server" ID="cusDptInfo" onitemdatabound="cusDptInfo_ItemDataBound" >
<ItemTemplate ><font size="60%">
<%# DataBinder.Eval(Container.DataItem, "FirstName") %> <%# DataBinder.Eval(Container.DataItem, "LastName") %><br />
<%# DataBinder.Eval(Container.DataItem, "GroupName") %><br />
<%# DataBinder.Eval(Container.DataItem, "Email") %><br />
<%# DataBinder.Eval(Container.DataItem, "CreationDate","{0:MM/dd/yyyy}") %><br />
<br /></font>
<asp:Repeater ID="rptItemList" runat="server">
<ItemTemplate>
<asp:Table ID="tblItemList" runat="server" Font-Size="7%">
<asp:TableRow>
<asp:TableCell><%# DataBinder.Eval(Container.DataItem,"Item")%> <%#DataBinder.Eval(Container.DataItem, "Category","({0})")%><br /><font color="gray" style="text-align:justify"><%# DataBinder.Eval(Container.DataItem, "ItemDescription") %></font></asp:TableCell>
<asp:TableCell HorizontalAlign="Right"><%# DataBinder.Eval(Container.DataItem,"Amount","{0:c}") %></asp:TableCell>
</asp:TableRow>
</asp:Table>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="rptOrderedTotAmount" runat="server">
<ItemTemplate> <div style="page-break-after:always;">
<asp:Table ID="tblItemListt" runat="server" Font-Size="7%">
<asp:TableRow>
<asp:TableCell HorizontalAlign="Right"><%# DataBinder.Eval(Container.DataItem, "TotalAmount","Total: {0:c}") %></asp:TableCell>
</asp:TableRow>
</asp:Table> </div>
<br />
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:Repeater>
</form>
</body>
</html>
and my code behind is like this:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.OleDb;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.html;
using iTextSharp.text.html.simpleparser;
namespace iTextSharpExample
{
public partial class _Default : System.Web.UI.Page
{
public static string strCnx = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=g:\\access\\CustomerOrderDetails.mdb;Jet OLEDB:System Database=g:\\access\\system.mdw;"
;
#region Properties
Repeater rptItemList;
Repeater rptOrderedTotAmount;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
}
protected void filetesting()
{
OleDbConnection cnx = new OleDbConnection(strCnx);
DataSet ds = new DataSet();
string catQuery = @"select * from CustomerOrder";
OleDbCommand objCmd = new OleDbCommand(catQuery, cnx);
OleDbDataAdapter objDAcategory = new OleDbDataAdapter(objCmd);
objDAcategory.Fill(ds, "CustomerOrder");
string totQuery = @"select OrderID,sum(Amount) As [TotalAmount] from OrderedItem where IsActive = '1' group by OrderID";
objCmd = new OleDbCommand(totQuery, cnx);
OleDbDataAdapter objDAtotal = new OleDbDataAdapter(objCmd);
objDAtotal.Fill(ds, "OrderedItem");
string itemQuery = @"select * from OrderedItem where IsActive='1'";
objCmd = new OleDbCommand(itemQuery, cnx);
OleDbDataAdapter objDAitem = new OleDbDataAdapter(objCmd);
objDAitem.Fill(ds, "OrderedItem");
DataRelation dRel = new DataRelation("CustomerOrder_OrderedItem", ds.Tables["CustomerOrder"].Columns["OrderID"], ds.Tables["OrderedItem"].Columns["OrderID"]);
ds.Relations.Add(dRel);
cusDptInfo.DataSource = ds;
cusDptInfo.DataBind();
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=iTextSharpExample.pdf");
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/pdf";
StringWriter stringwrite = new StringWriter();
HtmlTextWriter htmlwrite = new HtmlTextWriter(stringwrite);
cusDptInfo.RenderControl(htmlwrite);
StringReader sr = new StringReader(stringwrite.ToString());
Document pdfDoc = new Document(PageSize.A4, 50f, 50f, 40f, 40f);
PdfWriter writer = PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
string pcnt;
pcnt = (writer.CurrentPageNumber - 1).ToString();
pcnt = pcnt.Substring(1);
HeaderFooter header = new HeaderFooter(new Phrase("My Company \n Customer Order Details"), false) { Border = Rectangle.NO_BORDER, Alignment = Element.ALIGN_CENTER };
HeaderFooter footer = new HeaderFooter(new Phrase(pcnt), true) { Border = Rectangle.NO_BORDER, Alignment = Element.ALIGN_CENTER };
pdfDoc.Header = header;
pdfDoc.Footer = footer;
pdfDoc.Open();
_events e = new _events();
e.TimerText = DateTime.Now.ToString("MM/dd/yyyy");
writer.PageEvent = e;
htmlparser.Parse(sr);
pdfDoc.NewPage();
pdfDoc.Close();
Response.Write(pdfDoc);
}
protected void cusDptInfo_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
RepeaterItem item = e.Item;
if ((item.ItemType == ListItemType.Item) ||
(item.ItemType == ListItemType.AlternatingItem))
{
rptItemList = (Repeater)e.Item.FindControl("rptItemList");
DataRowView drv = (DataRowView)item.DataItem;
rptItemList.DataSource = drv.CreateChildView("CustomerOrder_OrderedItem");
rptItemList.DataBind();
rptOrderedTotAmount = (Repeater)e.Item.FindControl("rptOrderedTotAmount");
DataRowView drvTot = (DataRowView)item.DataItem;
rptOrderedTotAmount.DataSource = drvTot.CreateChildView("CustomerOrder_OrderedItem");
rptOrderedTotAmount.DataBind();
}
}
protected void pdfReportFromDatabase_Click(object sender, EventArgs e)
{
filetesting();
}
}
public class _events : PdfPageEventHelper
{
private string _timerText;
public string TimerText
{
get { return _timerText; }
set { _timerText = value; }
}
public override void OnEndPage(PdfWriter writer, Document document)
{
base.OnEndPage(writer, document);
Rectangle page = document.PageSize;
ColumnText.ShowTextAligned(writer.DirectContent, Element.ALIGN_RIGHT, new Phrase(TimerText), page.Right, page.Height - document.TopMargin, 0);
}
}
}
ok I need to page break once i get my TotalAmount. I had used style=page-break-after:always property under the nested repeater as shown. Its working for part of data and for part of data, its not working. Page break is happening for some part and for some part there is no page break. This is my problem. I need page break throughout my data.
suchita
|
|
|
|
|
This isn't even close to what originally asked. First you wanted to remove empty cells now you want page breaks in a PDF?
No comment
|
|
|
|