|
Frame is nothing but a window. How about body's onBeforeUnload or onUnload events for the documents that are loaded within that frame in discussion?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Message Removed
modified 1-Apr-13 2:40am.
|
|
|
|
|
how i add ajex file uploder in asp.net web form ??
|
|
|
|
|
|
Inside table td I have multiple div. Display a particular div on Jquery Click event. I am using Update panel in some div. All works fine in Mozilla and Chrome. But in IE, div width exceeds 10000px, is there any solution for this.
Bala
|
|
|
|
|
How do you expect anyone to comment based on what you have shared?
In order to display anything on a click, where from a width came into picture?
|
|
|
|
|
set the width using css
width: 980px;
updatepanels are just containers for partial page postbacks
|
|
|
|
|
hi friends,i need a help frm u guyz regarding for my project.i'm dng project in image processing domain project title is robust face name-graph matching for character identification in asp.net backend c# it's theme is to capturing image frm movie file and saved in database and comparison ll done but i didn't know comparison part if anybdy know pls send coding for this comparison part
|
|
|
|
|
We are all volunteers and only helpfull if we can see your approach, where you are stucck and, very important, what you have done so far and why the thing you have done yet does not work.
On the other hand, try to post here[^].
|
|
|
|
|
i did comparison of two images by getting two images pixel and width,height and check comparison of two images width and height ,pixel if its same means images r identical else different here i'll attach my coding part so far what i did
private button1 click()
{
this.Cursor = Cursors.WaitCursor;
Application.DoEvents();
// Load the images.
using (Bitmap bm1 = new Bitmap(txtFile1.Text))
{
using (Bitmap bm2 = new Bitmap(txtFile2.Text))
{
// Make a difference image.
int wid = Math.Min(bm1.Width, bm2.Width);
int hgt = Math.Min(bm1.Height, bm2.Height);
Bitmap bm3 = new Bitmap(wid, hgt);
// Create the difference image.
bool are_identical = true;
Color eq_color = Color.White;
Color ne_color = Color.Red;
for (int x = 0; x < wid; x++)
{
for (int y = 0; y < hgt; y++)
{
if (bm1.GetPixel(x, y).Equals(bm2.GetPixel(x, y)))
{
bm3.SetPixel(x, y, eq_color);
}
else
{
bm3.SetPixel(x, y, ne_color);
are_identical = false;
}
}
}
// Display the result.
picResult.Image = bm3;
this.Cursor = Cursors.Default;
if ((bm1.Width != bm2.Width) || (bm1.Height != bm2.Height)) are_identical = false;
if (are_identical)
{
MessageBox.Show("The images are identical");
}
else
{
MessageBox.Show("The images are different");
}
}
}
//pictureBox1.Image = txtFile1.Text.ToString();
//pictureBox2.ImageLocation = new Bitmap(openFileDialog2.FileName);
}
but tis'nt enough for me to comparing images bcoz it's too simple
for my project i need complexity for my project to compring images if u knw help me
|
|
|
|
|
rengaramu r wrote: s'nt enough for me to comparing images bcoz it's too simple
for my project i need complexity for my project to compring images if u knw help me
Comparing two images for equality only will always be simple - in fact, simpler than what you have already. Since you're only interested in equality, you should stop and return false as soon as you find one pixel different.
Now, if you're talking about image similarity, that can be very complex, in fact complex enough for graduate theses and Google R&D. Google has tried for many years to understand image similarity, and they do a pretty good job, but that is getting into a seriously complex area, and frankly, you don't seem to be ready for that.
However, you should be able to examine all the pixels, compare their distance away from each other (in terms of color values), then average those distances together, and it will give you a SIMPLE correlation value of how similar the images are. The code for that is simple...
foreach (px1, px2 in image) {
distance += SQRT( ((px1.red - px2.red)^2) + ((px1.blue - px2.blue)^2) + ((px1.green - px2.green)^2) )
numPix++;
}
correlation = distance/numPix;
Lower numbers indicate similarity. However, there are many problems with this algorithm, such as the fact that two pictures of the same thing, with a row of pixels added to one, will have a very high number, simply because the pixels don't line up. Any human looks at the two images and says "those are the same" but the computer fails at that.
Google and others now have image comparison tech that will give you a result like "those two images are both of a human face" and even go so far as "yes, there are faces in both images, and yes they are the same person" - right? That's what we call facial recognition software, but at its core that technology is image comparison and computer vision stuff.
|
|
|
|
|
thank u for ur reply yeah i got sme idea i tried to change it out
|
|
|
|
|
Good luck! There is really no middle ground - image comparison is either really simple, or ridiculously complex.
|
|
|
|
|
Well it sounds like your writing a windows program, this is the asp.net forum for web developers.
I'm not sure which forum is for windows managed code.
Anyways, if you had 2 identical images, actually the same image, then you could probably inspect each pixel in the image in the rows and columns, by color number, and see how many matches you get which should be 100%
But if you have 2 different sources for the image, and use a jpeg reducer, they may not compress the same leaving the image colors different so your match may only be 80% or none at all, even though they look the same to the human eye. The 2nd image may be offset by 1 row in the X or Y alignment creating a 0 match.
I've done work using pixels to determine the background color of an image, for automatic background color selection, and it took alot more code than what you posted to extract a good value.
You should probably Google the subject for awhile and look deeper into the subject.
|
|
|
|
|
I have programmatically generated a DataTable in ASP.NET 3.5 and now I want to use group by and do some calculations using SQL on this DataTable.
My question is: Is it possible to write a new SQL query against this DataTable and generate a new updated DataTable?
For eg:
select ID,sum(Rate) from dataTable group by ID
Sumit Kathuria
modified 28-Mar-13 14:26pm.
|
|
|
|
|
I've never seen it done.
You could push the datatable up to the SQL server in a #TEMP table, then do your SQL from there.
Not necessarily the best way to do things, but it would work.
|
|
|
|
|
You can use Linq Or Lamda Expression to form such query
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Rate");
dt.Rows.Add("1", "10");
dt.Rows.Add("1", "20");
dt.Rows.Add("2", "30");
dt.Rows.Add("2", "40");
var result = dt.AsEnumerable().GroupBy(row => row["ID"]).Select(GroupedRows => new { ID = GroupedRows.Key, SumOfRate = GroupedRows.Sum(row => Convert.ToDecimal(row["Rate"])) }).ToList();
|
|
|
|
|
I have developed a new ASP.NET (4) website on my client's domain using a server dedicated to me (it also runs SQL Server.) The problem is, I need to knwo who's accessing the site, and I can't seem to get Windows authentication to work for my users (works fine for me and at least one other....) In my global.aspx page, I look for authenticated users, and set up security. But my users are coming through with anonymous authentication. When I disable anonymous authentication, they get an HTTP:400 rejection.
I don't know where to look. I'm no IIS (7) expert, but I've tried every suggestion I can find on the forums, and I can't figure it out. Here's what I know so far...
...Windows Integrated security is enabled on my users' browsers (IE8/32bit)
...I've disabled Anonymous access to my site (HTTP://Servername/Timesheets/) and enabled Windows Authentication.
...I've set up my Web.Config file:
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
I can't even get any responses on the forums. Can anyone walk me through the process?
Jim
|
|
|
|
|
Hi guys,
I am beginner in MVC 4, I am facing problem to achieve one simple requirement. The problem described as below.
I have 3 roles(Programmer,reviewer,Admin) and 1 razor view, that has 4 panels and each panel has set of controls , depends on the role and the some condition i have to make panels visible false/true.
Please help me out.
Thanks and regards
Vishwa
|
|
|
|
|
In the Mvc application we can find ASPNETDB.MDF in Server Explorer.
Add roles (Programmer,reviewer,Admin) and its users to respective tables.
Now based on the logged-in user's role we can make panel visible property true or false.
Sample Code:
if (User.IsInRole("Administrator"))
adminPanel.Visible=True;
I hope this will help you.
Please accept it as answer if it helped you.
With Regards,
Rohith.
|
|
|
|
|
I'm pretty new to ASP.NET, building my first simple website using C#/RazorV2, hosting it on the free Windows Azure site.
I've found plenty of articles explaining how the URL structure works, and I've mostly got it figured out, but what I'm wondering is, what's the best/safest/most correct way of doing it?
Is it better to actually have multiple smaller files to handle things? Or is it "OK" or accepted to have one file handle several things?
For example, I'm building a simple blog web app, and right now I'm using single files to handle multiple sections, like I have a Blog.cshtml:
if (urlDepth > 0) {
renderPost = new List<BlogPost>();
switch (UrlData[0]) {
case "Post":
int _postID = 0;
_postID = Convert.ToInt32(UrlData[1]);
renderPost.Add(blogRender.ShowSinglePost(_postID));
Page.Title = renderPost[0].Name;
break;
case "Category":
BlogCategory selCat = catDisplay.GetCategory(UrlData[1]);
Page.Title = selCat.Name;
renderPost = blogRender.PostsInCategory(selCat.ID);
break;
}
} else {
renderPost = blogRender.MultiplePosts(10);
}
I know it's a bit crude as it is, but it's a work-in-progress, I plan on making it more failsafe as I go. But before I get too deep into it and possibly end up needing to tear it apart, would it be better to actually just make a folder named Blog, and have separate Post.cshtml and Category.cshtml files to handle their respective areas?
Figure it's best to know now so I can fix it if need be, rather than find out down the road that I messed up and have to try and pry apart the code.
If someone wants to see it in action to get a better idea of what I'm doing, it's currently at http://vouksh.azurewebsites.net/
|
|
|
|
|
IMO it is okay to handle differrent permission for the same thing, i.e. the admin can delete a blog post on the same page as a user can view blog posts.
I would not use the same page for Categories and blog posts because they are two different things.
The more features/things which can be display (categories, blog posts etc.) you add to a page the more crowded the pages' code behind gets and sooner or later you will loose the overview.
|
|
|
|
|
|
I have a checkboxlist populated by a datasource having a textbox as a controlparameter. The checkboxlist is located within a modalpopup. When I click the button, the checkboxlist shows the list pertaining to the previous select. If I close and click the button to show the modalpopup, the second click shows the updated checkboxlist. I've tried everything I can think of and nothing seems to work. The latest attempt is to have a dummy button (arcArcPat) for the modalpopup. I click on btnPrePat to get the dynamic checkbox, but no modalpopup appears. Of course, when I click on btnArcPat, everything's great because I've clicked on the btnPrePat first. I tried taking away the display:none; and then I only get a flash on the screen, nothing that stays. Help?
<pre lang="vb"><asp:Button ID="btnPrePat" runat="server" Text="pre arc" /><asp:Button ID="btnArcPat" runat="server" text="Search" />
<ajaxToolkit:ModalPopupExtender ID="mpePat" runat="server" TargetControlID="btnArcPat" PopupControlID="mpPat" DropShadow="true" BackgroundCssClass="modalBackground"></ajaxToolkit:ModalPopupExtender>
<asp:Panel ID="mpPat" runat="server" CssClass="modalPopup" Style="display: none;">
<asp:CheckBoxList ID="cblPat" runat="server" RepeatDirection="Vertical" Font-Size="12px" />
<asp:Button ID="btnPatClose" runat="server" Text="Close" />
</asp:Panel>
Protected Sub btnPrePat_Click(sender As Object, e As EventArgs) Handles btnPrePat.Click
ds = New Data.DataSet
strSql = "SELECT TOP (100) PERCENT t.patID, myType FROM blah, blah"
da = New Data.SqlClient.SqlDataAdapter(strSql, cn)
Try
da.Fill(ds, "patSearch1")
If ds.Tables("patSearch1").Rows.Count > 0 Then
cblPat.DataSource = ds.Tables("patSearch1")
cblPat.DataTextField = ds.Tables("pat").Columns("myType").ToString
cblPat.DataValueField = ds.Tables("pat").Columns("patID").ToString
cblPat.DataBind()
End If
Catch ex As Exception
Response.Write(ex.ToString)
End Try
mpePat.Show()
End Sub
</pre>
|
|
|
|
|
For anyone else, - just wanted you to know that I figured out the bigger problem. Something must have corrupted the ajaxcontroltoolkit installation just enough. Once I re-referenced it, everything started working fine. Sorry for the trouble and thanks for your help.
|
|
|
|
|