无法使用Google Sitemaps生成器(chrome扩展名)为angular 6构建项目生成sitemap.xml

时间:2019-02-28 13:27:36

标签: angular6 google-sitemap

Google sitemap生成器仅在angular 6构建项目中为主页生成sitemap.xml文件。不能整体为其他路由URL路径生成。

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://www.XXXXXXXX.com/home</loc>
</url>
</urlset>

1 个答案:

答案 0 :(得分:0)

您需要手动添加所有其他页面

    private string conStr = "Your connection string";
    private string facultyID = "";
    protected void login()
    {
        using (MySqlConnection con = new MySqlConnection(conStr))
        using (MySqlCommand cmd = new MySqlCommand("Select Faculty From Voter Where StudentID = @ID and Name = @Name;", con))
        {
            cmd.Parameters.AddWithValue("@ID", (int)txtID.Text);
            cmd.Parameters.AddWithValue("@Name", txtName.Text);
            con.Open();
            facultyID = cmd.ExecuteScalar().ToString();
        } //Connection and Command are closed and disposed here.
    }
    protected void loadCandidate()
    {
        DataTable dt = null;

        using (MySqlConnection con = new MySqlConnection(conStr))
        using (MySqlCommand cmd = new MySqlCommand("select studentID ,name from candidate Where Faculty = @FacultyID ", con))
        {
            cmd.Parameters.AddWithValue("@FacultyID", facultyID);
            con.Open();
            dt.Load(cmd.ExecuteReader());
        } //Connection and Command are closed and disposed here.
            GridView1.DataSource = dt;
            GridView1.DataBind();
    }